tags:

views:

23

answers:

1

Hi,

How can I convert a string to RemoteEndPoint ?

A: 

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.

Ben Gracewood
i've used that way, either there could be reasonable class without parsing.
softwaremonster