fnet - socket: How can I detect when the client has disconnected a TCP-connection?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fnet - socket: How can I detect when the client has disconnected a TCP-connection?

Jump to solution
726 Views
martinpi
Contributor III

Hi everybody,

I am using the fnet-stack.

I create a socket with socket(), bind() and accept().

The Client connects, I use the socket that is returned by accept()

and we both can send and receive.

When the Client disconnects, I see a FIN / FIN ACK / ACK sequence in Wireshark,

but how does my application know that the connection is closed (or timed out)?

The socket Status returned by getsockopt() is still 2 = SS_CONNECTED,

calls to subsequent sendto() do not yield an error

and the Information is sent as if the connection were still open.


So, how do I detect when the client has disconnected a TCP-connection?

Greetings, Martin

Tags (3)
0 Kudos
1 Solution
501 Views
martinpi
Contributor III

has been answered in a different thread. Thanx.

The answer is: use fnet_error_get()

View solution in original post

0 Kudos
1 Reply
502 Views
martinpi
Contributor III

has been answered in a different thread. Thanx.

The answer is: use fnet_error_get()

0 Kudos