lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] tcp connection state from app


From: Marc Boucher
Subject: Re: [lwip-users] tcp connection state from app
Date: Tue, 15 Apr 2003 13:42:15 -0400
User-agent: Mutt/1.5.1i

there are imho two socket API issues here; connection state querying and
disconnect notification.

The first issue could perhaps be addressed with an ioctl
or other similar mechanism; alternatively a 0-byte send or recv could
be used to test the connection state (ENOTCONN should be returned if
not connected), although this technique isn't applicable to 
message-oriented protocols (like UDP [connectionless so it doesn't
matter] or one day maybe SCTP [where it could matter]).

The second issue could be covered by adding exceptfds support to
lwip_select(). If asynchronous notification is needed, perhaps
a SIGIO-like event mechanism could be implemented? (maybe via callback
functions on platforms where unix-like signals are not available)

Marc

On Tue, Apr 15, 2003 at 12:45:51PM -0400, David Haas wrote:
> Hi all,
> 
> I need some advice. I have an application which is supporting tcp
> connections to redirect RS-232 ports over the network. This works just
> fine, but unfortunately this existing application does not pend on a
> read or a write from the socket and only calls select when it is in a
> certain mode. My problem is that the other end can drop the tcp
> connection. My app does not know this because it is not checking for I/O
> when it is in an idle state. I have another thread which I could use to
> check for a dropped connection, but I need to know the status of the tcp
> connection without actually doing any I/O (because any characters really
> read must go to the app, not the monitoring thread).
> 
> I can't figure out any "unixish" way to do this, but my solution is to
> add a little netconn_tcp_state() function to the API. Does anyone have a
> better suggestion?
> 
> Regards,
> David.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]