i

Python Programming

Python Socket or Server

So we understood few methods for transmitting bytes, Now create client / server program.

Above code makes a socket object and binds it to local-host’s port 8080 as socket server. When clients connect to this address with socket connection, the server listens data, and stores it in “data” variable.

Next, the program logs client data using “print,” and then sends string to client“I am server”.

Now take a look at client code that would interact with this server program.