How it works...

An instance of ForkingServer is launched in the main thread, which has been daemonized to run in the background. Now, the two clients have started interacting with the server.

If you run the script, it will show the following output:

$ python 2_1_forking_mixin_socket_server.py
Server loop running PID: 26479
PID 26479 Sending echo message to the server :
"Hello echo server!"
Sent: 18 characters, so far... Server sending response [current_process_id: data] = [26481: Hello echo server!] PID 26479 received: b': Hello echo server!' First client running PID 26479 Sending echo message to the server : "Hello echo server!" Sent: 18 characters, so far... Server sending response [current_process_id: data] = [26482: Hello echo server!] PID 26479 received: b': Hello echo server!' Second client running

The server port number might be different in your machine since this is dynamically chosen by the operating system kernel.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.127.37