Example #1
0
 def set_connection_host(self, connection, host, port):
     """Change the address used by the connection.  The address is
     used by the reactor's iohandler to create an outgoing socket
     connection.  This must be set prior to opening the connection.
     """
     pn_reactor_set_connection_host(self._impl, connection._impl,
                                    unicode2utf8(str(host)),
                                    unicode2utf8(str(port)))
Example #2
0
 def set_connection_host(self, connection, host, port):
     """Change the address used by the connection.  The address is
     used by the reactor's iohandler to create an outgoing socket
     connection.  This must be set prior to opening the connection.
     """
     pn_reactor_set_connection_host(self._impl,
                                    connection._impl,
                                    unicode2utf8(str(host)),
                                    unicode2utf8(str(port)))
Example #3
0
 def acceptor(self, host, port, handler=None):
     impl = _chandler(handler, self.on_error)
     aimpl = pn_reactor_acceptor(self._impl, unicode2utf8(host), str(port), impl)
     pn_decref(impl)
     if aimpl:
         return Acceptor(aimpl)
     else:
         raise IOError("%s (%s:%s)" % (pn_error_text(pn_io_error(pn_reactor_io(self._impl))), host, port))