Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
[zeromq] Avoid exception when the space is not a DistributedSpace.
Browse files Browse the repository at this point in the history
see #86

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Nov 15, 2014
1 parent e2b3a65 commit 19bbe08
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,16 @@ public void spaceCreated(Space space, boolean isLocalCreation) {
}
if (!isUsed) {
// The space was not used to be connected to a remote host => put in a buffer.
ZeroMQNetworkService.this.bufferedSpaces.put(
space.getID(),
new BufferedSpace(space.getID(),
(NetworkEventReceivingListener) space));
if (space instanceof NetworkEventReceivingListener) {
ZeroMQNetworkService.this.bufferedSpaces.put(
space.getID(),
new BufferedSpace(space.getID(),
(NetworkEventReceivingListener) space));
} else {
ZeroMQNetworkService.this.logger.error(
ZeroMQNetworkService.class,
"NOT_DISTRIBUTABLE_SPACE", space); //$NON-NLS-1$
}
} else {
// The buffer was consumed by the "magicConnect"
ZeroMQNetworkService.this.bufferedSpaces.clear();
Expand Down Expand Up @@ -780,5 +786,5 @@ public void kernelDisconnected(URI peerURI) {
}

}

}

0 comments on commit 19bbe08

Please sign in to comment.