Chat Application


A chat application allows users to interact or communicate by texting, audio, and video. It can be useful for social or commercial activities.

In this assignment, students are required to write a Chat Program based on Windows Socket Programming C++. The program should allow users to chat concurrently on the Internet (i.e., User A can send encrypted messages to User B, and vice versa). You can download the sample programs (namely, “server.cpp” and “client.cpp”) from the Web site. The program should consist of the following modules:

  1. User management: provide functions to add, delete, or group users;
  2. Group chat: allow users to chat as a group;
  3. Management of connections: support at least three concurrent connections.

User Management: Implemented By Server

  • Server: Store the User Information

Group chat: Group started by Client

  • Server Provide all users for Client User to select.

Management of connections: Give every User a Threads



同时,我们在服务端引入了mutex来保证传输数据的正确性。当多个用户向同一个用户发送数据时,服务器push 传输的数据进入 特定用户的消息队列 上锁