Fixed an event ordering issue. The server now only

first the connection added event after sending the
connect confirmation to the client.  This prevents
a resource deadlock if the connection listener
tries to send a message to the client and the
client tries to send a response back... since the
client won't have been fully initialized yet.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7854 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
PSp..om 14 years ago
parent a67dbf9977
commit a0dea25ec5
  1. 8
      engine/src/networking/com/jme3/network/base/DefaultServer.java

@ -312,16 +312,16 @@ public class DefaultServer implements Server
if( addedConnection != null ) {
log.log( Level.INFO, "Client registered:{0}.", addedConnection );
// Now we can notify the listeners about the
// new connection.
fireConnectionAdded( addedConnection );
// Send the ID back to the client letting it know it's
// fully connected.
m = new ClientRegistrationMessage();
m.setId( addedConnection.getId() );
m.setReliable(true);
addedConnection.send(m);
// Now we can notify the listeners about the
// new connection.
fireConnectionAdded( addedConnection );
}
}

Loading…
Cancel
Save