I am totaly a newbie of C# and developing.
I am trying to build a solution that has to use a socket.
So far I got quite honest results.
A part of my code is made in this way:
As you can see this is a loop that permit me to have a push on a TCP stream (by using Socket).Code:while (true)
{
try
{
data1 = mystreamreader.ReadLine();
listBox1.Items.Add(data1);
i++;
//MessageBox.Show(data1);
}
catch
{
}
}
The problem is that while the while loop is going my application works but is almost frozen. So is impossible to proceed with others threads.
I would like to use the multithreading tecnology but I don't know how to implement it. I mean ... how I can call method in a thread class of objects that are defined in other parts of the code?
Can you help me giving some advices or solution
Thanks in advance