pyBegin / projects / socket
🐍

Socket example

15 lines🖥 Desktop only

Socket example

Implementation of a socket in python

Example

Terminal 1 (server):

$ python ./server.py
Server runing in port  3000
New conection ('127.0.0.1', 54321)
b'Hello from client'

Terminal 2 (client):

$ python ./client.py
b' Hello from server!'

How to run on localhost

# fist run the server
python ./server.py
# then run the client
python ./client.py