Do not tinker with the 0mq socket for the ConnectionSocketActor on Restart

This commit is contained in:
Viktor Klang 2012-04-04 11:08:28 +02:00
parent 8163555378
commit 2ee712a8b1
2 changed files with 11 additions and 3 deletions

View file

@ -50,7 +50,7 @@ private[akka] abstract class Mailbox(val actor: ActorCell, val messageQueue: Mes
* Try to enqueue the message to this queue, or throw an exception.
*/
def enqueue(receiver: ActorRef, msg: Envelope): Unit = messageQueue.enqueue(receiver, msg)
/**
* Try to dequeue the next message from this queue, return null failing that.
*/

View file

@ -131,10 +131,18 @@ private[zeromq] class ConcurrentSocketActor(params: Seq[SocketOption]) extends A
}
}
override def preRestart(reason: Throwable, message: Option[Any]) {
context.children foreach context.stop //Do not call postStop
}
override def postRestart(reason: Throwable) {} //Do nothing
override def postStop {
try {
poller.unregister(socket)
if (socket != null) socket.close
if (socket != null) {
poller.unregister(socket)
socket.close
}
} finally {
notifyListener(Closed)
}