Socket serverSocket=new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp); //获取Socket
IPAddress ipAddress=IPAddress.Parse("192.168.0.109"); //绑定IP
IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, 891); //绑定端口
serverSocket.Bind(ipEndPoint);//绑定IP和端口号