Socket General Methods
These are the general methods of the socket module. Let’s see each method in detail.
Function Name | Description |
---|---|
s.send() | Sends the TCP message |
s.sendto() | Sends the UDP message |
s.recv() | Receives the TCP message |
s.recvfrom() | Receives the UDP message |
s.close() | Close the socket |
socket.ghostname() | Returns the host name |
Python Network Programming
Python provides two levels of access to network programming. These are –
- Low-Level Access: At the low level, you can access the basic socket support of the operating system. You can implement client and server for both connection-oriented and connectionless protocols.
- High-Level Access: At the high level allows to implement protocols like HTTP, FTP, etc.
In this article, we will discuss Network Socket Programming. But before getting started let’s understand what are sockets.
Contact Us