in communication/src/main/scala/org/apache/toree/communication/socket/ZeroMQSocketRunnable.scala [65:95]
protected def processOptions(socket: ZMQ.Socket): Unit = {
val socketOptionsString = socketOptions.map("\n- " + _.toString).mkString("")
logger.trace(
s"Processing options for socket $socketType: $socketOptionsString"
)
// Split our options based on connection (bind/connect) and everything else
val (connectionOptions, otherOptions) = socketOptions.partition {
case Bind(_) | Connect(_) => true
case _ => false
}
// Apply non-connection options first since some (like identity) must be
// run before the socket does a bind/connect
otherOptions.foreach {
case Linger(milliseconds) => socket.setLinger(milliseconds)
case Subscribe(topic) => socket.subscribe(topic)
case Identity(identity) => socket.setIdentity(identity)
case option => logger.warn(s"Unknown option: $option")
}
// Perform our bind or connect
connectionOptions.foreach {
case Bind(address) => socket.bind(address)
case Connect(address) => socket.connect(address)
case option =>
logger.warn(s"Unknown connection option: $option")
}
_isProcessing = true
}