def __init__(self, local_uri, logger, use_acm=False): GreenTransportBase.__init__(self) if local_uri is not None and not isinstance(local_uri, protocol.URI): raise TypeError('Not MSRP URI instance: %r' % (local_uri, )) # The following members define To-Path and From-Path headers as following: # * Outgoing request: # From-Path: local_uri # To-Path: local_path + remote_path + [remote_uri] # * Incoming request: # From-Path: remote_path + remote_uri # To-Path: remote_path + local_path + [local_uri] # XXX self.local_uri = local_uri if logger is None: logger = Logger() self.logger = logger self.local_path = [] self.remote_uri = None self.remote_path = [] self.use_acm = use_acm self._msrpdata = None
def write(self, bytes, wait=True): """Write `bytes' to the socket. If `wait' is true, wait for an operation to complete""" self.logger.report_out(bytes, self.transport) return GreenTransportBase.write(self, bytes, wait)