|
__init__(family=PR_AF_INET,
type=PR_DESC_SOCKET_TCP)
x.__init__(...) initializes x; see help(type(x)) for signature |
|
|
|
|
a new object with type S, a subtype of T
|
|
|
|
|
|
(Socket, NetworkAddress)
|
accept(timeout=PR_INTERVAL_NO_TIMEOUT)
The socket is a rendezvous socket that has been bound to an address
with Socket.bind() and is listening for connections after a call to
Socket.listen(). |
|
|
(Socket, NetworkAddress, buf)
|
accept_read(amount,
timeout=PR_INTERVAL_NO_TIMEOUT)
Socket.accept_read() combines the behavior of Socket.accept() and
Socket.recv(). |
|
|
|
bind(addr)
When a new socket is created, it has no address bound to
it. |
|
|
|
close()
Close the socket. |
|
|
|
connect(addr,
timeout=PR_INTERVAL_NO_TIMEOUT)
Socket.connect() is usually invoked on a TCP socket, but it may also
be invoked on a UDP socket. |
|
|
integer
|
fileno()
Return the integer file descriptor of the socket. |
|
|
NetworkAddress
|
get_peer_name()
Return the network address for the connected peer socket. |
|
|
NetworkAddress
|
get_sock_name()
Return the network address for this socket. |
|
|
|
get_socket_option(option)
The method return values varies depending on the option, see below: |
|
|
|
listen(backlog=5)
Socket.listen() turns the specified socket into a rendezvous
socket. |
|
|
file object
|
makefile(mode=...,
buffersize=...)
Return a regular file object corresponding to the socket. |
|
|
the next value, or raise StopIteration
|
|
|
read(size=-1)
If the length of the returned buffer is 0 this indicates the network
connection is closed. |
|
|
buf
|
readline(size=...)
Read one entire line from the socket. |
|
|
[buf]
|
readlines(sizehint=...)
Read until EOF using Socket.readline() and return a list containing
the lines thus read. |
|
|
buf
|
recv(amount,
timeout=PR_INTERVAL_NO_TIMEOUT)
Socket.recv() blocks until some positive number of bytes are
transferred, a timeout occurs, or an error occurs. |
|
|
buf
|
recv_from(amount,
addr,
timeout=PR_INTERVAL_NO_TIMEOUT)
Socket.recv_from() blocks until some positive number of bytes are
transferred, a timeout occurs, or an error occurs. |
|
|
amount
|
send(buf,
timeout=PR_INTERVAL_NO_TIMEOUT)
Socket.send() blocks until all bytes are sent (unless the socket is in
non-blocking mode), a timeout occurs, or an error occurs. |
|
|
amount
|
send_to(buf,
addr,
timeout=PR_INTERVAL_NO_TIMEOUT)
Socket.send_to() blocks until all bytes are sent (unless the socket is in
non-blocking mode), a timeout occurs, or an error occurs. |
|
|
amount
|
sendall(buf,
timeout=PR_INTERVAL_NO_TIMEOUT)
Socket.sendall() blocks until all bytes are sent (unless the socket is in
non-blocking mode), a timeout occurs, or an error occurs. |
|
|
|
set_socket_option(option,
...)
The method signature varies depending on the option, see below: |
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|