I'm writing software for an Android device used as a remote control for an 
industrial process being run by a PC.   The PC is always listening and the 
Android device opens a connection via the Android socket class, which 
provides a client-side TCP socket.     Once the connection is established 
commands flow back and forth over the connection.     The PC can close the 
connection at any time, issuing a FIN, asynchronously.   My requirement is 
that I display this on the Android device as soon as it happens.
   
Studying the Android socket, it does not seem to be event driven.   There 
doesn't seem to be any way to raise an event or a callback if the server 
closes the connection.   It looks like the first sign I'll have is getting 
an error if I try to send something.     Is this true or am I 
misunderstanding something?    The guys on the PC side don't believe it 
because they say that their TCP socket software raises an event and calls a 
handler if a connection is closed on the other end.

So does this mean I'm going to have to sit in a timer-controlled loop and 
poll endlessly just to find out when the server has closed the connection 
or am I overlooking a better option?    

Thanks in advance.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to