开发者

Knowing the family with Socket Descriptor

I have the socket descriptor which is the return value of socket API. How can I use only this to know the fa开发者_如何学编程mily?


You can call getsockname, but only after the socket is bound.


(Windows-specific): you can get SO_PROTOCOL_INFO socket option.

If successful, it would give you WSAPROTOCOL_INFO structure with iAddressFamily member.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜