Convert TCPInfo to socket

2 views
Skip to first unread message

alex

unread,
Nov 24, 2009, 8:43:08 AM11/24/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hello,

My program is connected to a box. I connect to the box thanks to a
socket. My problem is:

I open an other module of my program. I can't have access to the
instance of my socket. So I would like to get the active TCP
connections and get the related socket.

I tried with the method GetActiveTCPConnections. I see my TCP
connections. How can I get the related socket?

I can only have one TCP connection on the box. So if I want to connect
one more time I have an exception. And If I disconnect my socket and
reconnect. I think it is not the best solution.

Do you have an idea?

Processor Devil

unread,
Nov 25, 2009, 3:14:22 AM11/25/09
to dotnetde...@googlegroups.com
Make your socket public so you can access it even from other classes.
P.S. It is not reasonable to make the whole socket public, just make some public function which can write or read data from the socket, that's it.

2009/11/24 alex <alexis....@gmail.com>
Reply all
Reply to author
Forward
0 new messages