首页 > > 详细

C辅导:Chat Room讲解留学生JSP

Introduction
c,。
,。,
。。
Requirement
you will implement a multi-user chat program. In C program please.
The Bare Minimum
The minimum requirement is for a central server that can accept two connections.
Either client can then type a message, which is then sent to the server. The server
relays the message to the other client. A sample run of the program might look like the
following:
> ./chat 127.0.0.1
What is your screen name? >> KitC
KitC has joined the chat.
Linda has joined the chat.
>> Hi, Linda. Are we having our meeting later today?
[Your Message Has Been Sent]
Linda: No. I’m really busy writing our paper and
a couple other people have conflicts.
>> Okay. Thanks!
[Your Message Has Been Sent]
>> exit
KitC has left the chat.
This is only an example interface, but shows the minimum requirements of sending
messages between the clients. A confirmation that your message has been sent by the
client is also a requirement at this level.
Level 2 Requirements
In Level 2, a few more features may be added. In the example above, there were
notifications when a user entered or left the chat. Level 2 code should add this feature.
At this level, the server should be able to accept multiple connections | not just two.
That means that the server needs to keep track of who sent a message and distribute
it to all of the other clients except the one who sent it.
Buffet Features
If you have time or interest, you can add any or all of the following features.
Private messages between clients (Something like @replies in Twitter)
Sending a message to a subset of clients
Add some pretty formatting to the messages (like colors, line wrapping, etc.)

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!