Hi @Noah Aas , Welcome to Microsoft Q&A,
- IPv4: 32-bit address format, typically written as four decimal numbers separated by dots (e.g.,
83.235.77.69
). - IPv6: 128-bit address format, written as eight groups of four hexadecimal numbers separated by colons (e.g.,2001:0db8:85a3:0000:0000:8a2e:0370:7334
). - IPv4 typically relies on NAT to manage the IP address shortage.
- IPv6 has an abundant address space and typically eliminates the need for NAT, simplifying end-to-end connectivity
- IPv4 is limited to approximately 4.3 billion addresses, which is insufficient for modern needs.
- IPv6 addresses this limitation by providing a huge address space (approximately 340 exabytes).
If you need to support both protocols, make sure to configure Socket
in dual stack mode by setting SocketOptionName.IPv6Only
to false
. This allows both IPv4 and IPv6 clients to connect.
For TCP examples you can check out these two days of information I found: C# server that supports IPv6 and IPv4 on the same port and Using ipv6 address to connect to a server using HttpClient
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.