Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
如果您希望能够向他们发送某些内容,则必须(至少)维护已连接客户端的列表。
不要重新发明轮子,在这里查看您需要的内容:构建Java 聊天服务器请参见第 22 页,类 Server,方法 sendToAll(String message)
Server
sendToAll(String message)
祝你好运!
You must (at least) maintain a list of connected clients if you want to be able to send them something.
Don't reinvent the wheel, peek what you need here: Building a Java chat serverSee page 22, class Server, method sendToAll(String message)
Good luck!
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
如果您希望能够向他们发送某些内容,则必须(至少)维护已连接客户端的列表。
不要重新发明轮子,在这里查看您需要的内容:构建Java 聊天服务器
请参见第 22 页,类
Server
,方法sendToAll(String message)
祝你好运!
You must (at least) maintain a list of connected clients if you want to be able to send them something.
Don't reinvent the wheel, peek what you need here: Building a Java chat server
See page 22, class
Server
, methodsendToAll(String message)
Good luck!