Socket Programming in Python

Sowmiya K
Sep 7, 2021

Socket programming is a way of connecting two nodes on a network to communicate with each other.

To begin with socket programming, beforehand we need to install socket package. Either you can use pip install socket command in command prompt or you can use juypter notebook by using !pip install socket.

Server.py

Client.py

Output

Server.py

laddr — local address, raddr — remote address

Client.py

In client.py, we received the message. When you run the program beyond 10 sec, message won’t appear and give timeout, because here I used s.settimeout(10)

--

--

Sowmiya K

Working for HCL as a Senior Software Engineer | Interested in Networking | cybersecurity | Python