March 2003
Intermediate to advanced
656 pages
39h 30m
English
socket
socket(family,type)
Creates and returns a socket object with the given family and type.
family is usually the constant attribute
AF_INET of module socket,
indicating you want a normal, Internet (i.e., TCP/IP) kind of socket.
Depending on your platform, family may
also be another constant attribute of module
socket. For example, AF_UNIX,
on Unix-like platforms only, indicates that you want a Unix-kind
socket. This book does not cover sockets that are not of the Internet
kind, since it focuses on cross-platform Python.
type is one of a few constant attributes
of module socket; generally,
type is SOCK_STREAM to
create a TCP (connection-based) socket, or
SOCK_DGRAM to create a UDP (datagram-based)
socket.
Read now
Unlock full access