开发者

Dual Socket for Windows

开发者 https://www.devze.com 2022-12-16 22:20 出处:网络
On Unix one ca开发者_Python百科n have single socket used for both IPv6 and IPv4 ( dual mode ). On windows this is not supported. Does anybody has solution for implementing the same using same socket f

On Unix one ca开发者_Python百科n have single socket used for both IPv6 and IPv4 ( dual mode ). On windows this is not supported. Does anybody has solution for implementing the same using same socket for Windows.


Check http://msdn.microsoft.com/en-us/library/bb513665(VS.85).aspx:

Dual-Stack Sockets

In order to support both IPv4 and IPv6 on Windows XP with Service Pack 1 (SP1) and on Windows Server 2003, an application has to create two sockets, one socket for use with IPv4 and one socket for use with IPv6. These two sockets must be handled separately by the application.

Windows Vista and later offer the ability to create a single IPv6 socket which can handle both IPv6 and IPv4 traffic. For example, a TCP listening socket for IPv6 is created, put into dual stack mode, and bound to port 5001. This dual-stack socket can accept connections from IPv6 TCP clients connecting to port 5001 and from IPv4 TCP clients connecting to port 5001. This feature allows for greatly simplified application design and reduces the resource overhead required of posting operations on two separate sockets.

HTH


.NET Framework 4.5 now has dual mode support.

0

精彩评论

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