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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
894件の閲覧回数
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

タグ(3)
0 件の賞賛
返信
1 解決策
669件の閲覧回数
martinpi
Contributor III

has been answered in a different thread. Thanx.

The answer is: use fnet_error_get()

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
670件の閲覧回数
martinpi
Contributor III

has been answered in a different thread. Thanx.

The answer is: use fnet_error_get()

0 件の賞賛
返信