def __init__(self, port=ONEP_TIPC_PORT): """Initialize a TTIPCSocket @param port(int) The (TIPC) port to connect to. """ TSocket.__init__(self, port=port) self.setTimeout(TTIPCSocket.ONEP_TIPC_TIMOUT * 1000.0)
def __init__(self, host='localhost', port=9090, unix_socket=None): """Initialize a TNoDelaySocket. Args: host: The host to connect to. port: The port to connect to. unix_socket: The filename of a unix socket to connect to. In this case, host and port will be ignored. """ TSocket.__init__(self, host=host, port=port, unix_socket=unix_socket)
def __init__(self, host, port, proxy_host, proxy_port): TSocket.__init__(self, proxy_host, proxy_port) try: # Use IP address since sometimes proxy_host cannot resolve # external hostnames using unbound info = socket.getaddrinfo(host, None, socket.AF_INET | socket.AF_INET6, socket.SOCK_STREAM, socket.IPPROTO_TCP) self.remote_host = info[0][4][0] except socket.error as e: raise TTransportException(TTransportException.NOT_OPEN, str(e)) self.remote_port = port
def __init__(self, host='localhost', port=7228, ssl=False): TSocket.__init__(self, host, port) self.ssl = ssl