Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no event raised when a peer half-closes the connection. #4

Open
juj opened this issue Aug 24, 2012 · 0 comments
Open

There is no event raised when a peer half-closes the connection. #4

juj opened this issue Aug 24, 2012 · 0 comments

Comments

@juj
Copy link
Owner

juj commented Aug 24, 2012

The INetworkServerListener::ClientDisconnected(kNet::MessageConnection* source) callback is signalled when a connection on the server is fully bidirectionally closed.

However, there does not exist a corresponding event that would get signalled when the network peer only half-closes (write-closes) the connection. Therefore to be able to respond to these remote write-closes and to bidirectionally close the connection, one has to poll to detect this.

Add a signal that gets raised when a connection is write-closed from remote end, so that the code path can avoid polling.

As a workaround, one can poll like this:

// Periodically in application main loop
if (messageConnection->GetConnectionState() == kNet::ConnectionPeerClosed)
messageConnection->Disconnect(); // Peer has write-closed. Write-close from this end as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant