I have a List of Sockets that are connected and live on the Form1
List<Socket> Clients;
For Example i want to Pass on of the Socket to the next Forms as:
Form2 F2 = new Form2();
F2.ClientSocket = Clients[2];
So I want to Close the Socket :
Clients[2]
and let the F2.ClientSocket Opened
just like we're passing the connection from socket to socket !
Thanks for your Time !
F2.ClientSockettoClients[2]so how could it be the next socket?Clients[2]andF2.ClientSocketrefer to the same object. If you shutdown one you shutdown the other too. Just don't read fromClients[2]once you pass it off. Or remove it from the list entirely since you really don't need it anymore.