I'm thinking about the asynchronous solution, but, it will continue the code
in the main thread. I'm not sure that it works for me. The code after the
Receive, is for managing the sent data.
Do you see my problem? I'm migrating an old VB6 application, and it uses the
DataArrival event.
--
Regards,
Diego F.
- Show quoted text -
The Async methods are based on callbacks, so it is going to be similar
to the way it works with the dataarival event, but with a little more
housekeeping.
By the way, either way - manual thread creation or the BeginXXX
methods, you will be unable to directly access the UI. Both methods
cause a thread creation, it's just using the async methods take care
of it and are very effiecient. So, you may want to look at this
series of articles on windows forms and multithreading:
http://msdn2.microsoft.com/en-us/library/ms951089.aspx
That's a link to the first part - but it is a 3 part article, so read
it all
The other option is to use the sync method, and use a backgroundworker
component... Or find a 3rd party component.