casualjim/akka — comment on commit 44b6c73b816a20c5a8d06339f7670fac3ca20cd3
File:  line 0
By casualjim:

in our own code we have an extra method in which we build up the SocketParameters class based on the parameters of the newSocket method.

that looks like this:

```scala
protected def newSocket(socketType: SocketType.Value, options: SocketOption*) = {
val socketTimeout = options find (_.isInstanceOf[Timeout]) map (_.asInstanceOf[Timeout].value) getOrElse 100L
val deserializer = options find (_.isInstanceOf[MessageDeserializer]) map (_.asInstanceOf[MessageDeserializer].value) getOrElse new ZMQMessageDeserializer
val listener: Option[ActorRef] = options find (_.isInstanceOf[SocketListener]) map (_.asInstanceOf[SocketListener].value) orElse Some(self)
val timeo = akka.util.Duration(socketTimeout, TimeUnit.MILLISECONDS)
val realOptions = options filterNot {
case _: Timeout | _: MessageDeserializer | _: SocketListener ⇒ true
case _ ⇒ false
}
val params = SocketParameters(
context,
socketType,
listener,
deserializer = deserializer,
pollTimeoutDuration = timeo,
options = realOptions)
ZeroMQ.newSocket(params, self.some, self.dispatcher)
}
```

so the timeout is used fo the pollTimeoutDuration