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

Disconnect overtakes final message #108

Open
GamesVineyard opened this issue May 17, 2021 · 1 comment
Open

Disconnect overtakes final message #108

GamesVineyard opened this issue May 17, 2021 · 1 comment

Comments

@GamesVineyard
Copy link

When I send a message and disconnect a client immediately afterwards (in the same tick) it seems like this last message is being dropped. I was wondering if the framework shouldn't make sure that no messages are lost, meaning that message and disconnect are processed in the appropriate order.

This is a simple code example in C#:

var message = new FinalMessage();
client.Send(message.Serialize());
client.Disconnect();

The FinalMessage will not arrive at the host.

@GamesVineyard
Copy link
Author

The cause of this problem is that the client does not care about messages in its queue when closing the connection. This is, I guess, because Telepathy is mainly used for authoritative servers. In that scenario, you do not care about messages sent to the server when you are sure you will not get the server's answer.
In my case, I need the client to reliably send all messages to the server. If you are interested in the workaround I implemented, you can have a look at my client.cs file. I cloned the repository and the file can be viewed under Client.cs.
But as I said, it's only a hacky workaround which suits my needs.

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