Beta version Sprint sixth day

Source: Internet
Author: User

Team Cleancode

031302505 Huang

031302223 Ong Handsome

031302511 Limberchen

031302632 Zhang Yukun

031302536 Suliling

I. Completion of the situation:

At night, we discussed how to implement the chat function. Because of the success of the current market examples of how to achieve, we do not understand. The exact way to do this is as follows: Each time the client socket connects to the ServerSocket, the program stores the corresponding socket into the clients collection and initiates a thread for the socket that handles all the communication tasks for that socket. When the server thread reads the client data, the server stores the clients socket through the map, uses the client user ID as the key of the map, and when a sends a message to B, it searches for the socket of B and establishes their communication channel. On the offline information, this is mainly the function that the server assumes, I use the database to save the data. Client A sends a message to client B in the offline state, and the server will determine if client B is online, and if it is offline, it is stored in MySQL, and when client B is online, the server looks for its offline information, and if it has unread information, will be sent in a timely manner. Client B will be able to receive offline information. Do not know the method is not possible. I hope the teacher gives some advice. Our team is going to try.

Beta version Sprint sixth day

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.