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: http://jmonkeyengine.googlecode.com/svn/trunk@7854
75d07b2b-3a1a-0410-a2c5-
0572b91ccdca
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 );
}
}