Using C++, I wanted to do the following:

{
     static zmq::socket_t socket(zmqContext, ZMQ_UPSTREAM) ;
     static const char* connectedTo = NULL ;

     if ( connectedTo != NULL )
     {
         socket.close() ;    // Disconnect previous connection
     }
     if ( connectedTo != newDestination )
     {
         if ( socket.connect(newDestination) != 0 )
             throw std::invalid_argument("Couldn't connect to 
destination") ;
         else
             connectedTo = newDestination ;
     }

     socket.send(data) ;
}

But the only way to close a socket in C++ seems to be to destroy the 
socket_t?

- Oliver
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to