P
PiotrKolodziej
Hi
I have a simple question. Here is the code related to my question:
while (true)
{
if (tcpListenerServer.Pending() && !this.Disposing)
{
TcpClient tcpClient =
tcpListenerServer.AcceptTcpClient();
downloadThreadClass obj = new
downloadThreadClass(tcpClient.GetStream());
Thread myThread = new Thread(new
ThreadStart(obj.downloadThreadFunction));
myThread.Start();
}
}
TcpClient object returned by AccepTcpClient is destroyed right after program
leaved 'if' block.
before program do this, i'am passing NetworkStream from tcpClient to the
thread which is proceeding some task on this stream.
The question is will it work? The stream is retreved but tcpClient will not
exist during operations on this stream.
Thanks
PK
I have a simple question. Here is the code related to my question:
while (true)
{
if (tcpListenerServer.Pending() && !this.Disposing)
{
TcpClient tcpClient =
tcpListenerServer.AcceptTcpClient();
downloadThreadClass obj = new
downloadThreadClass(tcpClient.GetStream());
Thread myThread = new Thread(new
ThreadStart(obj.downloadThreadFunction));
myThread.Start();
}
}
TcpClient object returned by AccepTcpClient is destroyed right after program
leaved 'if' block.
before program do this, i'am passing NetworkStream from tcpClient to the
thread which is proceeding some task on this stream.
The question is will it work? The stream is retreved but tcpClient will not
exist during operations on this stream.
Thanks
PK