The server that implements socket communication in Python is complex, and the client is very simple, so the client is basically implemented by the SOCKCT module, and the service
There are many modules that can be used for the end, as follows:
1, the Client
2. Socketserver Module
In order to enable multiple clients to access the service and communicate at the same time, the server will use the Socketserver module to implement, so that the user does not have to use the parent process to process it after the child thread ends, and does not care about the socket closure, everything is done by Socketserver.
/span>
In the following tests, I use the other host and the two interrupts of the machine to connect to the server, can be connected properly and can be interactive data reply
Note: This program example runs on platform Rhel7.2.x86_64,python version 3.6.2, for the Windows platform and non-identical Python version of the user may lack some compatibility, if other platform users please fix it yourself!!
Join the buckle group 813622576 Get free information, we exchange learning
Python multi-threaded socket programming-Multiple Client Access