You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a server disconnects a connection that has ReliableSequencedFragmented as the channel type (and potentially others), any pending packets are not sent to the client. This results in "friendly disconnects" (use case - user is on the wrong version of the client, needs a message telling them to upgrade, then disconnect them) not being received by the client, since the _pendingSends aren't flushed to the socket, they're simply reclaimed. See ReliableSequencedFragmented.Release().
I believe I understand the motivation - the Disconnect event should disconnect immediately and not dump data to clients - but there isn't a mechanism to flush() partial packets to users. Unfortunately, I think alternative approaches are not good (ask the client to disconnect in the "final packet" and trust them to do so; mark a connection as pending disconnect and complete the disconnect after MergeDelay amount of time; or my solution - expose a second Send() method with noMerge=true for these scenarios).
I'm not sure if this repo is being actively developed any further with the maintainer moving over into other unity networking solutions, but if the maintainer (or anyone else capable) would like to, this would be a nice feature, both for this use case and others.
Proposal 1: Add Flush() to IChannel and implement in the various channel implementations
Proposal 2: Expose method for polling count of _pendingSends in the channels.
Proposal 3: Add another Disconnect() method or parameter that attempts to Flush() pending/unmerged packets to the client.
Thanks for the consideration
The text was updated successfully, but these errors were encountered:
When a server disconnects a connection that has
ReliableSequencedFragmented
as the channel type (and potentially others), any pending packets are not sent to the client. This results in "friendly disconnects" (use case - user is on the wrong version of the client, needs a message telling them to upgrade, then disconnect them) not being received by the client, since the_pendingSends
aren't flushed to the socket, they're simply reclaimed. SeeReliableSequencedFragmented.Release()
.I believe I understand the motivation - the Disconnect event should disconnect immediately and not dump data to clients - but there isn't a mechanism to flush() partial packets to users. Unfortunately, I think alternative approaches are not good (ask the client to disconnect in the "final packet" and trust them to do so; mark a connection as pending disconnect and complete the disconnect after
MergeDelay
amount of time; or my solution - expose a secondSend()
method with noMerge=true for these scenarios).I'm not sure if this repo is being actively developed any further with the maintainer moving over into other unity networking solutions, but if the maintainer (or anyone else capable) would like to, this would be a nice feature, both for this use case and others.
Proposal 1: Add
Flush()
to IChannel and implement in the various channel implementationsProposal 2: Expose method for polling count of
_pendingSends
in the channels.Proposal 3: Add another
Disconnect()
method or parameter that attempts toFlush()
pending/unmerged packets to the client.Thanks for the consideration
The text was updated successfully, but these errors were encountered: