Пример #1
0
 def _connect(self, server=None, port=None):
     """Same as `ComponentStream.connect` but assume `self.lock` is acquired."""
     if self.me.node or self.me.resource:
         raise Value, "Component JID may have only domain defined"
     if not server:
         server = self.server
     if not port:
         port = self.port
     if not server or not port:
         raise ValueError, "Server or port not given"
     Stream._connect(self, server, port, None, self.me)
Пример #2
0
 def _connect(self,server=None,port=None):
     """Same as `ComponentStream.connect` but assume `self.lock` is acquired."""
     if self.me.node or self.me.resource:
         raise Value, "Component JID may have only domain defined"
     if not server:
         server=self.server
     if not port:
         port=self.port
     if not server or not port:
         raise ValueError, "Server or port not given"
     Stream._connect(self,server,port,None,self.me)
Пример #3
0
 def _connect(self, server=None, port=None):
     """Same as `ClientStream.connect` but assume `self.lock` is acquired."""
     if not self.my_jid.node or not self.my_jid.resource:
         raise ClientStreamError, "Client JID must have username and resource"
     if not server:
         server = self.server
     if not port:
         port = self.port
     if server:
         self.__logger.debug("server: %r", (server, ))
         service = None
     else:
         service = "xmpp-client"
     if port is None:
         port = 5222
     if server is None:
         server = self.my_jid.domain
     self.me = self.my_jid
     Stream._connect(self, server, port, service, self.my_jid.domain)
Пример #4
0
 def _connect(self,server=None,port=None):
     """Same as `ClientStream.connect` but assume `self.lock` is acquired."""
     if not self.my_jid.node or not self.my_jid.resource:
         raise ClientStreamError,"Client JID must have username and resource"
     if not server:
         server=self.server
     if not port:
         port=self.port
     if server:
         self.__logger.debug("server: %r", (server,))
         service=None
     else:
         service="xmpp-client"
     if port is None:
         port=5222
     if server is None:
         server=self.my_jid.domain
     self.me=self.my_jid
     Stream._connect(self,server,port,service,self.my_jid.domain)