Hi,
How can I convert a string to RemoteEndPoint ?
Hi,
How can I convert a string to RemoteEndPoint ?
RemoteEndPoint is a property of a Socket, so you'd need to create a Socket first:
IPEndPoint ip = new IPEndPoint(address, port);
Socket mySocket = new Socket(ip.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
So if you have a string something like "127.0.0.1:25", you need to grab the address and port components. Try myEndPointString.Split(":") to get the two components out.