|
3驿站币
本帖最后由 2191265529 于 2018-7-27 16:31 编辑
- WINSOCK_API_LINKAGE SOCKET WSAAPI accept(
- SOCKET s,
- sockaddr *addr,
- int *addrlen
- );
复制代码
Parameters
s
A descriptor that identifies a socket that has been placed in a listening state with the listen function. The connection is actually made with the socket that is returned by accept.
addr
An optional pointer to a buffer that receives the address of the connecting entity, as known to the communications layer. The exact format of the addr parameter is determined by the address family that was established when the socket from the sockaddr structure was created.
addrlen
An optional pointer to an integer that contains the length of structure pointed to by the addr parameter.
第二个参数会返回一些客户端的IP,端口,协议族等信息,第三个参数干嘛用的? |
最佳答案
查看完整内容
总长度不变,但是里面有的有效长度是多少就不一定了。
而且第二个参数现在你是传的结构体,实际上也可以直接传递个char类型的数组,东西一样会放进去
上一篇: CheckRadioButton下一篇: 虚拟机USB口识别不了
|