Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dual Socket for Windows

On Unix one can 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.

like image 216
Avinash Avatar asked Jun 17 '26 13:06

Avinash


1 Answers

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

like image 156
jrbjazz Avatar answered Jun 19 '26 03:06

jrbjazz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!