def __init__(self, sock, address, blocking=1, **kw): """Initialize a client connection by sending the socket object connection to the client and the client's address. If the blocking flag is set to false then the socket will be configured for non-blocking operations.""" Socket.__init__(self, address, blocking=blocking, **kw) self.socket = sock self._setsockopts()
def __init__(self, address, **kwargs): """Creates a Socket object with the address used to open a socket connection when open() is called. address should be a tuple like is sent to a socket, i.e. ('funyuns', 1234). If the blocking flag is set to false then the socket will be configured for non-blocking operations after it is opened.""" Socket.__init__(self, address, **kwargs) # if set, should give the time the connection was authenticated self.authenticated = 0 # time that connect was called, not necessarily the time the # socket was opened. self.connecttime = 0L # time that we established a connection with the remote address self.opentime = 0L