Пример #1
0
 def get_connection_address(self, connection):
     """This may be used to retrieve the remote peer address.
     @return: string containing the address in URL format or None if no
     address is available.  Use the proton.Url class to create a Url object
     from the returned value.
     """
     _url = pn_reactor_get_connection_address(self._impl, connection._impl)
     return utf82unicode(_url)
Пример #2
0
 def get_connection_address(self, connection):
     """This may be used to retrieve the remote peer address.
     @return: string containing the address in URL format or None if no
     address is available.  Use the proton.Url class to create a Url object
     from the returned value.
     """
     _url = pn_reactor_get_connection_address(self._impl, connection._impl)
     return utf82unicode(_url)
Пример #3
0
 def get_connection_address(self, connection):
     """This may be used to retrieve the host address used by the reactor to
     establish the outgoing socket connection.
     @return: string containing the address in URL format or None if no
     address assigned.  Use the proton.Url class to create a Url object from
     the returned value.
     """
     _url = pn_reactor_get_connection_address(self._impl, connection._impl)
     return utf82unicode(_url)
Пример #4
0
 def selector(self):
     """ Creates a selector expression of the offset """
     if isinstance(self.value, datetime.datetime):
         epoch = datetime.datetime.utcfromtimestamp(0)
         milli_seconds = timestamp(
             (self.value - epoch).total_seconds() * 1000.0)
         return Selector(u"amqp.annotation.x-opt-enqueued-time > '" +
                         str(milli_seconds) + "'")
     elif isinstance(self.value, timestamp):
         return Selector(u"amqp.annotation.x-opt-enqueued-time > '" +
                         str(self.value) + "'")
     else:
         operator = ">=" if self.inclusive else ">"
         return Selector(u"amqp.annotation.x-opt-offset " + operator +
                         " '" + utf82unicode(self.value) + "'")