Networking in Python
Networking in any programming language is needed to send messages over different across networks.
Sockets and Socket APIs are used to send messages across network and they function as IPC(inter-process-Communication).
Sockets are created using a set of programming request called socket API (Application Programming Interface).
Sockets are the communcation gateway between server & client.
Steps :
Define Socket(TCP,UDP etc) (g = socket.socket (socket_family, type_of_socket, protocol=value))
Write methods to manage connections form server to client & vice versa.
Common Server Socket Methods
listen(): is used to establish and start TCP listener.
bind(): is used to bind address (host-name, port number) to the socket.
accept(): is used to TCP client connection until the connection arrives.
connect(): is used to initiate TCP server connection.
send(): is used to send TCP messages.
recv(): is used to receive TCP messages.
recvfrom():is used to send UDP messages
sendto(): is used to send UDP messages
close(): is used to close a socket.