Python multi-threaded socket programming-Multiple Client Access

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.