Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- //This code makes a single socket listen for IPv4 and IPv6 connections
- Socket sock = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
- sock.SetSocketOption(SocketOptionLevel.IPv6, (SocketOptionName)27, 0);
- sock.Bind(new IPEndPoint(IPAddress.IPv6Any, 8000));
- sock.Listen(4);
- Socket client = sock.Accept();
- Console.WriteLine("Client has connected successfully with the server");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement