Skip to Content
Python Network Programming Cookbook - Second Edition
book

Python Network Programming Cookbook - Second Edition

by Pradeeban Kathiravelu, Dr. M. O. Faruque Sarker
August 2017
Beginner
450 pages
13h 21m
English
Packt Publishing
Content preview from Python Network Programming Cookbook - Second Edition

How it works...

In order to see the client/server interactions, launch the following server script in one console:

$ python 1_13a_echo_server.py --port=9900 
Starting up echo server  on localhost port 9900 
    
Waiting to receive message from client 
  

Now, run the client from another Terminal as follows:

$ python 1_13b_echo_client.py --port=9900 
Connecting to localhost port 9900 
Sending Test message. This will be echoed 
Received: Test message. Th 
Received: is will be echoe 
Received: d 
Closing connection to the server
  

Upon receiving the message from the client, the server will also print something similar to the following message:

Data: Test message. This will be echoed 
sent Test message. This will be echoed bytes back to ('127.0.0.1', ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Network Programming

Python Network Programming

Abhishek Ratan, Eric Chou, Pradeeban Kathiravelu, Dr. M. O. Faruque Sarker

Publisher Resources

ISBN: 9781786463999Supplemental Content