TCPlistener.BeginAcceptSocket - async question

Posted by Mirek on Stack Overflow See other posts from Stack Overflow or by Mirek
Published on 2009-11-15T13:28:38Z Indexed on 2010/04/29 11:27 UTC
Read the original article Hit count: 761

Filed under:
|
|
|

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
        }

© Stack Overflow or respective owner

Related posts about c#

Related posts about multithreading