Here are the instructions on compiling and running each program:
ChatServer.java
First, compile this java file through cmd:
javac ChatServer.java
to ChatServer.class.
Second, run this class file also through cmd:
java ChatServer <port>
Now the chat server is running. This chat server will accept all the GUIClient's connections and broadcast their statements and messages. At the same time, the broadcast contents will be displayed on the chat server's console window just as same as the GUIClient's message format. The chat server manager can look out them very quickly and conveniently.
Note:
1. If no port number input, the chat server wouldn't run.
2. If the GUIClient send an unacceptable request to the chat server, the program will input an error message on the chat server's console window.
3. If the GUIClient send a message which has character "^" in the middle, the chat server will change them into blanks automatically.
4. If the same nickname appears, the chat server will make the nicknames different automatically.
GUIClient.jar
When a chat server has run, you can open another cmd window and run the given client program like this:
Java 每jar GUIClient.jar <hostname> <port> <nickname>
Then the connection between client and chat server will be built. And you can chat with each other clients through a GUI window.
When someone joins in, the chat box will display:
Server: <nickname> has joined from <client name> (<current time>)
When someone part out, the chat box will display:
Server: <nickname> has parted out who is at <client name> (<current time>)
When someone sends message, the chat box will display:
<nickname> : <message>
Note:
1. If you don't input the hostname, port number or your nickname with correct formation to the GUIClient, the program will input an error message on the screen.
2. When chatting, you can input "^" in the sentences. But the other GUIClients will not be able to receive it.
ssd8 PracticalQuiz1参考答案
5星 · 超过95%的资源 需积分: 20 113 浏览量
2010-05-16
10:53:32
上传
评论 1
收藏 3KB RAR 举报
hoop11111
- 粉丝: 15
- 资源: 76
最新资源
- 课设毕设基于SSM的旅游景点线路网站 LW+PPT+源码可运行.zip
- EDA实验计数器CNT9999-DTCNT9999实验源代码
- 课设毕设基于SSM的抗疫医疗用品销售平台 LW+PPT+源码可运行.zip
- 基于Halcon的仿照VisonPro的机器视觉软件.zip
- battery-percentage-detector 使用 Javascript 的电池百分比检测器
- 毕业设计基于Qt+FFmpeg+SDL实现的音视频播放器源码.zip
- 课设毕设基于SSM的固定资产管理系统 LW+PPT+源码可运行.zip
- 课设毕设基于SSM的个人交友网站 LW+PPT+源码可运行.zip
- 课设毕设基于SSM的高校信息资源共享平台 LW+PPT+源码可运行.zip
- 课设毕设基于SSM的高校二手交易平台 LW+PPT+源码可运行.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
前往页