المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Asynchronous Question



C# Programming
12-05-2009, 11:51 AM
Hi all,

Some background information:

I have a method A that calls another method B. In method B an asynchronous TCP/IP read occurs: this.tcpClient.GetStream().BeginRead(byteReadBuffer, 0, byteReadBuffer.Length, new AsyncCallback(ProcessReadBuffer), tcpClient.GetStream()); on result method ProcessReadBuffer

So my question:

How can I wait for the asynchronous ProcessReadBuffer method to complete in method B. Reason being that I require some results from ProcessReadBuffer method in method A?

Many thanks in advance.
Kind regards,



The only programmers that are better C# programmers, are those who look like this -> http://www.barakasoft.com/script/Forums/Images/alien.gif


http://www.barakasoft.com/script/Forums/Images/coffee.gif Programm3r
My Blog: ^_^ (http://www.codeproject.com/script/profile/whos_who.asp?msg=1917620&id=2823228#xx1917620xx)