Hi there,
I'm having some problems using thread and async methods.
I tried doing a simple socket connection and after failing to use async and await keywords I just used a thread. My code looks like this:
Thread t = new Thread(() =>
{
//Socket socket1 = new Socket();
Socket server = new Socket ("10.100.101.103", 13137);
socket1.ConnectAsync (server.RemoteSocketAddress);
});
t.Start();
This is the client code. The connection is being made and I can get to the client from the server. The problem is that the client is stuck on this thread and can't get forward. even though I tried adding "notify()" inside/outside the thread.
Thanks a lot, Alon.
Answers
Doesn't the code below work?
What Socket are you using?
cannot await a void (because of the connectAsync method).
Also tried manipulate into Task version but it didn't work.