I donβt understand the question exactly, but if you have a list of addresses with software that listens on some ports, try connecting there using, for example. Socket Class:
Socket m_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); m_Socket.Connect(serverEndPoint);
and eventually try to catch the exception ...
If you have a connection that is already made in your code, you can check the m_Socket.Connected .. property.
source share