_socket
index
/usr/lib/python2.1/lib-dynload/_socket.so

Implementation module for socket operations.  See the socket module
for documentation.

 
Classes
            
exceptions.Exception
socket.error
socket.sslerror

 
class error(exceptions.Exception)
       
  
__getitem__(...) from exceptions.Exception
__init__(...) from exceptions.Exception
__str__(...) from exceptions.Exception

 
class sslerror(exceptions.Exception)
       
  
__getitem__(...) from exceptions.Exception
__init__(...) from exceptions.Exception
__str__(...) from exceptions.Exception

 
Functions
            
fromfd(...)
fromfd(fd, family, type[, proto]) -> socket object
 
Create a socket object from the given file descriptor.
The remaining arguments are the same as for socket().
gethostbyaddr(...)
gethostbyaddr(host) -> (name, aliaslist, addresslist)
 
Return the true host name, a list of aliases, and a list of IP addresses,
for a host.  The host argument is a string giving a host name or IP number.
gethostbyname(...)
gethostbyname(host) -> address
 
Return the IP address (a string of the form '255.255.255.255') for a host.
gethostbyname_ex(...)
gethostbyname_ex(host) -> (name, aliaslist, addresslist)
 
Return the true host name, a list of aliases, and a list of IP addresses,
for a host.  The host argument is a string giving a host name or IP number.
gethostname(...)
gethostname() -> string
 
Return the current host name.
getprotobyname(...)
getprotobyname(name) -> integer
 
Return the protocol number for the named protocol.  (Rarely used.)
getservbyname(...)
getservbyname(servicename, protocolname) -> integer
 
Return a port number from a service name and protocol name.
The protocol name should be 'tcp' or 'udp'.
htonl(...)
htonl(integer) -> integer
 
Convert a 32-bit integer from host to network byte order.
htons(...)
htons(integer) -> integer
 
Convert a 16-bit integer from host to network byte order.
inet_aton(...)
inet_aton(string) -> packed 32-bit IP representation
 
Convert an IP address in string format (123.45.67.89) to the 32-bit packed
binary format used in low-level network functions.
inet_ntoa(...)
inet_ntoa(packed_ip) -> ip_address_string
 
Convert an IP address from 32-bit packed binary format to string format
ntohl(...)
ntohl(integer) -> integer
 
Convert a 32-bit integer from network to host byte order.
ntohs(...)
ntohs(integer) -> integer
 
Convert a 16-bit integer from network to host byte order.
socket(...)
socket(family, type[, proto]) -> socket object
 
Open a socket of the given type.  The family argument specifies the
address family; it is normally AF_INET, sometimes AF_UNIX.
The type argument specifies whether this is a stream (SOCK_STREAM)
or datagram (SOCK_DGRAM) socket.  The protocol argument defaults to 0,
specifying the default protocol.
ssl(...)
ssl(socket, keyfile, certfile) -> sslobject

 
Data
             AF_APPLETALK = 5
AF_AX25 = 3
AF_BRIDGE = 7
AF_INET = 2
AF_INET6 = 10
AF_IPX = 4
AF_NETROM = 6
AF_PACKET = 17
AF_ROSE = 11
AF_UNIX = 1
AF_UNSPEC = 0
AF_X25 = 9
INADDR_ALLHOSTS_GROUP = -536870911
INADDR_ANY = 0
INADDR_BROADCAST = -1
INADDR_LOOPBACK = 2130706433
INADDR_MAX_LOCAL_GROUP = -536870657
INADDR_NONE = -1
INADDR_UNSPEC_GROUP = -536870912
IPPORT_RESERVED = 1024
IPPORT_USERRESERVED = 5000
IPPROTO_EGP = 8
IPPROTO_ICMP = 1
IPPROTO_IDP = 22
IPPROTO_IGMP = 2
IPPROTO_IP = 0
IPPROTO_PUP = 12
IPPROTO_RAW = 255
IPPROTO_TCP = 6
IPPROTO_TP = 29
IPPROTO_UDP = 17
IP_ADD_MEMBERSHIP = 35
IP_DEFAULT_MULTICAST_LOOP = 1
IP_DEFAULT_MULTICAST_TTL = 1
IP_DROP_MEMBERSHIP = 36
IP_HDRINCL = 3
IP_MAX_MEMBERSHIPS = 20
IP_MULTICAST_IF = 32
IP_MULTICAST_LOOP = 34
IP_MULTICAST_TTL = 33
IP_OPTIONS = 4
IP_RECVOPTS = 6
IP_RECVRETOPTS = 7
IP_RETOPTS = 7
IP_TOS = 1
IP_TTL = 2
MSG_CTRUNC = 8
MSG_DONTROUTE = 4
MSG_DONTWAIT = 64
MSG_EOR = 128
MSG_OOB = 1
MSG_PEEK = 2
MSG_TRUNC = 32
MSG_WAITALL = 256
PACKET_BROADCAST = 1
PACKET_FASTROUTE = 6
PACKET_HOST = 0
PACKET_LOOPBACK = 5
PACKET_MULTICAST = 2
PACKET_OTHERHOST = 3
PACKET_OUTGOING = 4
PF_PACKET = 17
SOCK_DGRAM = 2
SOCK_RAW = 3
SOCK_RDM = 4
SOCK_SEQPACKET = 5
SOCK_STREAM = 1
SOL_IP = 0
SOL_SOCKET = 1
SOL_TCP = 6
SOL_UDP = 17
SOMAXCONN = 128
SO_ACCEPTCONN = 30
SO_BROADCAST = 6
SO_DEBUG = 1
SO_DONTROUTE = 5
SO_ERROR = 4
SO_KEEPALIVE = 9
SO_LINGER = 13
SO_OOBINLINE = 10
SO_RCVBUF = 8
SO_RCVLOWAT = 18
SO_RCVTIMEO = 20
SO_REUSEADDR = 2
SO_SNDBUF = 7
SO_SNDLOWAT = 19
SO_SNDTIMEO = 21
SO_TYPE = 3
SSLType = <type 'SSL'>
SocketType = <type 'socket'>
TCP_MAXSEG = 2
TCP_NODELAY = 1
__file__ = '/usr/lib/python2.1/lib-dynload/_socket.so'
__name__ = '_socket'