Ok, I'll try to explain myself.
Here's the class Client
public class Client
{
private IPAddress ip;
[NonSerialized] private TcpClient client;
private string version;
private string userName;
private string realName;
private FileStream fileObj;
private string fileName;
}
In a form I have an ArrayList of Clients.
So whenever I want to send a message to all this Clients I go like
this:
foreach(Client c in clients)
{
_client = new TcpClient(c.IP. ToString(),8080 ); //Create new TcpClient
every time
StreamWriter stream = new StreamWriter(_c lient.GetStream ());
stream.Write("H ello World");
stream.Flush();
}
This works just fine, but what I wish to do is this
foreach(Client c in clients)
{
StreamWriter stream = new StreamWriter(c. tcpClient.GetSt ream());
//Cause the client allready has an instance of a TcpClient
stream.Write("H ello World");
stream.Flush();
}
But this does not work, it won't throw any exceptions either, It just
won't reach the other computer.
I hope it helps understand my problem.
Regards,
Sebastián
--
http://sgomez.blogspot.com