Questions about the network programming client server model !! Urgent

Source: Internet
Author: User
Questions about the network programming client server model !! Urgent-Linux general technology-Linux programming and kernel information. The following is a detailed description. I didn't quite understand it at the beginning. Most Simple examples of programming books I have read are about the communication between the client and the server, that is, the client sends data to the server, and the server replies to the client after processing. However, communication between two clients is not achieved. How can we achieve communication between customers?
If TCP needs to establish a link for each customer before communication, the link cannot be established with other users before it is released. If concurrent processing is required for multiple users at the same time, you can use multi-process, multi-thread, and other methods. I haven't learned multi-process multithreading yet, but I think if UDP is used, the server does not need to establish a connection with the customer. As long as the server continuously receives and forwards data, is it possible to process multi-user (or between two users) communication without using concurrency?
For example, only two clients can communicate with each other. The general idea is that customer 1 sends data, which contains the address information of Customer 2. After receiving the message, the server does not directly reply to Customer 1, but forwards it to Customer 2 using functions such as sendto. I don't know if this can be achieved through a single process? If the server cannot be specified to send to one of the clients. After the broadcast is sent, let the client determine whether it is the other party rather than the data sent by the server, and then display it to achieve the purpose of communication?
So much. I mainly want to ask if there are too many processes, multithreading, Or I/O multiplexing, And the select function can implement communication between two customers even if something I don't know. A lot of things can be reduced. I don't need to be able to have a wide range of applications, as long as the two can achieve two-way communication.
Related Article

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.