From a0dea25ec5b9912d43a6da551ec3d3250f18ed4d Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Tue, 12 Jul 2011 20:07:11 +0000 Subject: [PATCH] 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 --- .../networking/com/jme3/network/base/DefaultServer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/networking/com/jme3/network/base/DefaultServer.java b/engine/src/networking/com/jme3/network/base/DefaultServer.java index 235334641..a669ff326 100644 --- a/engine/src/networking/com/jme3/network/base/DefaultServer.java +++ b/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 ); } }