TCPlistener.BeginAcceptSocket - async question
- by Mirek
Hi,
Some time ago I have payed to a programmer for doing multithread server. In the meantime I have learned C# a bit and now I think I can see the slowndown problem - I was told by that guy that nothing is processed on the main thread (Form) so it cannot be frozen..but it is.
But I think that altough BeginAcceptSocket is async operation, but its callback runs on the main thread and if there is locking, thats the reason why the app freezes. Am I right?
Thanks
this.mTcpListener.BeginAcceptSocket(this.AcceptClient, null);
protected void AcceptClient(IAsyncResult ar)
{
//some locking stuff
}