springtg / lidgren-network-gen3

Automatically exported from code.google.com/p/lidgren-network-gen3
0 stars 0 forks source link

Messages sent right after approving a connection are dropped since r281 #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
r281 introduces a check in NetConnection.EnqueueMessage() which won't enqueue a 
message if the connection status is different from Connected.

I used to send a message right after calling Approve() on a connection in my 
ConnectionApproval handler and although it was enqueued in earlier revisions, 
starting with r281 it's now dropped right away because the connection is still 
marked as RespondedAwaitingApproval. 

I wanted to bring this behavior change to your attention since I'm not 100% 
positive it was done on purpose. I changed my code to pass my message to 
Approve(msg) instead of Approve()'ing and sending a message independently, 
which seems like a more sensible thing to do anyway.

Original issue reported on code.google.com by elise...@gmail.com on 24 Jan 2012 at 10:31

GoogleCodeExporter commented 9 years ago
After reading through the library code some more I believe the connection is 
marked as RespondedConnect, not RespondedAwaitingApproval, once it has been 
Approve()'d.

Original comment by elise...@gmail.com on 24 Jan 2012 at 10:35

GoogleCodeExporter commented 9 years ago
Yes, it's a change in behaviour. However, I believe the current behaviour is 
the correct one. Since there's no connection in place until the handshake has 
completed we can't really send reliable messages so it makes sense to prohibit 
sending messages until status is Connected. But thanks for the heads up!

Original comment by lidg...@gmail.com on 25 Jan 2012 at 1:39

GoogleCodeExporter commented 9 years ago
Sounds good, thanks for checking!

Original comment by elise...@gmail.com on 25 Jan 2012 at 1:40