Package wtf :: Package impl :: Module _connection :: Class Connection
[hide private]
[frames] | no frames]

Class Connection

source code

object --+
         |
        Connection

Connection abstraction
Instance Methods [hide private]
 
__init__(self, sock, peername)
Initialization
source code
 
__del__(self) source code
 
close(self)
Close the connection
source code
file
reader(self)
Create a new reading stream for the socket
source code
file
writer(self)
Create a new writing stream for the socket
source code
 
settimeout(self, timeout)
Set a socket timeout for next operations
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
socket.socket _sock = None
Actual connection socket
tuple remote_addr
tuple of remote address and port (the latter is -1 on UNIX domain sockets) ((addr, port))
tuple server_addr
tuple of server address and port (the latter is -1 on UNIX domain sockets) ((addr, port))
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, sock, peername)
(Constructor)

source code 
Initialization
Parameters:
  • sock (socket.socket) - The actual connection socket
  • peername (str or tuple) - The peername (got from accept)
Overrides: object.__init__

reader(self)

source code 
Create a new reading stream for the socket
Returns: file
reading stream

writer(self)

source code 
Create a new writing stream for the socket
Returns: file
writing stream

settimeout(self, timeout)

source code 
Set a socket timeout for next operations
Parameters:
  • timeout (float) - Socket timeout to set