📜  C# 套接字绑定到 dns 名称 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:14.594000             🧑  作者: Mango

代码示例1
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPAddress address = Dns.GetHostAddresses(ip)[0];
socket.Bind(new IPEndPoint(address, port));