PC Review


Reply
Thread Tools Rate Thread

async socket reads conflict with the user interface???

 
 
cebess
Guest
Posts: n/a
 
      13th Dec 2004
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?




 
Reply With Quote
 
 
 
 
cebess
Guest
Posts: n/a
 
      13th Dec 2004
Thanks -
it's pretty well covered by:
http://msdn.microsoft.com/mobility/u...hreadedapp.asp


 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      13th Dec 2004
....and for code that works around the limitations of Control.Invoke on CF go
here:
http://www.danielmoth.com/Blog/2004/...d-full-fx.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"cebess" <(E-Mail Removed)> wrote in message
news:eU%(E-Mail Removed)...
> Thanks -
> it's pretty well covered by:
> http://msdn.microsoft.com/mobility/u...hreadedapp.asp
>



 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      13th Dec 2004
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.

"cebess" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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?
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Async socket EnzoA Microsoft VC .NET 1 10th May 2005 01:51 PM
Async Socket: How to tell when there is no more data. mscirri@osmose.com Microsoft C# .NET 5 17th Mar 2005 10:53 PM
Async socket IO Alexander Muylaert Microsoft C# .NET 2 24th Oct 2004 11:20 AM
Async Socket IO Pete Davis Microsoft C# .NET 2 24th Mar 2004 10:16 PM
Async UDP socket Azmodan Microsoft Dot NET Framework 1 3rd Sep 2003 10:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:17 PM.