Skip to content
Snippets Groups Projects
Commit 8db3a6c6 authored by BIGARET Sebastien's avatar BIGARET Sebastien
Browse files

Fixed: on the server side RMIComm.Facade#connected() was not called

As a result, the disconnect() counterpart was always ignored, which
prevented a client that has been previously brutally disconnected (no
notifiction to the server) to be unable to reconnect anymore, until
the server was restarted!
parent 25b56627
No related branches found
No related tags found
No related merge requests found
Pipeline #60 failed
......@@ -8,6 +8,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Semaphore;
import eu.telecom_bretagne.praxis.common.Log;
import eu.telecom_bretagne.praxis.common.events.Event.IncompatibleListenerException;
......@@ -198,7 +199,11 @@ public abstract class CommunicationFacade
protected synchronized void connected()
{
if ( connected )
{
Log.log.finest("Already connected");
return;
}
Log.log.finest("connected, notifying listeners");
connected = true;
event_listeners_modification_semaphore.acquireUninterruptibly();
ArrayList<EventListener> event_listeners_copy;
......@@ -211,7 +216,10 @@ public abstract class CommunicationFacade
event_listeners_modification_semaphore.release();
}
for (EventListener listener: event_listeners_copy)
{
Log.log.finest("connected, notifying listener "+listener.toString());
listener.connected();
}
}
......@@ -222,8 +230,12 @@ public abstract class CommunicationFacade
*/
protected synchronized void disconnect(Exception reason)
{
Log.log.finest("disconnect reason:"+(reason!=null?reason.toString():"<null>"));
if ( ! connected )
{
Log.log.finest("already disconnected, nothing to do");
return;
}
connected = false;
event_listeners_modification_semaphore.acquireUninterruptibly();
......
......@@ -191,6 +191,7 @@ public class RMICommunicationFacade
}
RMICommunicationFacade c = new RMICommunicationFacade(clientIP);
new Server(c);
c.connected();
return CNX.buildCNX(c, Configuration.getBoolean("rmi.useSSL"));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment