async socket reads conflict with the user interface???

  • Thread starter Thread starter cebess
  • Start date Start date
C

cebess

I have a relatively straightforward telnet socket connection program that
reads
information asynchronously from on a pocketPC with a GUI. I need to do an
async read, since the information
can come in at any time. It all seems to run great except that after a while
(and it seems to have something to do with me doing an activity on the user
interface - for example clicking the send button) it locks up.

After I enter the async response method, I call sendEnd, put the results
into a read only text box and set up for the next async read.

The GUI can send information at any time, so I have async writes as well
that are driven by a button on the GUI. The socket is set non-blocking.

When it does lock up and I hit break all in the debugger, I am dropped into
the closing brace after the Application.Run :

static void Main()
{
Application.Run(new Form1());
} <--- it stops right here!

Any ideas as to what might be causing the program to lock up?
 
You need to add some type of logging capability to your application. If you
are threading and sending data to the UI from a thread other than the main
UI thread, make sure you are using Invoke() (as covered here time and time
again).

Paul T.
 
Back
Top