文件名称:Server
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2013-07-07
- 文件大小:
- 24kb
- 下载次数:
- 0次
- 提 供 者:
- 需**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
聊天程序主要利用Java网络包中的服务器套接字和客户端套接字实现,其核心部分的实现思路如下:
服务器根据指定的端口创建服务器套接字,并在该端口侦听连接请求;
每一个新加入的客户端创建客户端套接字,与服务器进行连接;
每一个连接在服务器有一个连接池保持连接;
当其中的一个客户端发出群聊或者上线下线信息后,对应的连接的服务器程序在接收到该消息后,向其所维持的所有的客户连接广播该消息。当客户端发出单独聊天,文件传输等需要发给指定用户的消息时,服务器端遍历连接池找到对应客户端,将消息单独发给该客户端。-Chat program using mainly Java network package server socket and client socket implementation, the core part of the implementation ideas are as follows: the server according to the specified port to create a server socket and listens for connection requests on this port each a new client create a client socket connection with the server each one connected to the server has a connection pool to stay connected When one client sends a group chat or offline on-line information, the corresponding connection server program receives the message, to maintain all of its client connection broadcasts the message. When the client makes a separate chat, file transfer and other users need to specify a message sent to the server-side connection pooling find the corresponding traversal client, the message is sent separately to the client.
服务器根据指定的端口创建服务器套接字,并在该端口侦听连接请求;
每一个新加入的客户端创建客户端套接字,与服务器进行连接;
每一个连接在服务器有一个连接池保持连接;
当其中的一个客户端发出群聊或者上线下线信息后,对应的连接的服务器程序在接收到该消息后,向其所维持的所有的客户连接广播该消息。当客户端发出单独聊天,文件传输等需要发给指定用户的消息时,服务器端遍历连接池找到对应客户端,将消息单独发给该客户端。-Chat program using mainly Java network package server socket and client socket implementation, the core part of the implementation ideas are as follows: the server according to the specified port to create a server socket and listens for connection requests on this port each a new client create a client socket connection with the server each one connected to the server has a connection pool to stay connected When one client sends a group chat or offline on-line information, the corresponding connection server program receives the message, to maintain all of its client connection broadcasts the message. When the client makes a separate chat, file transfer and other users need to specify a message sent to the server-side connection pooling find the corresponding traversal client, the message is sent separately to the client.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Server\build\built-jar.properties
......\.....\classes\server\CS.class
......\.....\.......\......\Server.class
......\build.xml
......\deny.txt
......\.ist\README.TXT
......\....\Server.jar
......\manifest.mf
......\nbproject\build-impl.xml
......\.........\genfiles.properties
......\.........\private\private.properties
......\.........\.......\private.xml
......\.........\project.properties
......\.........\project.xml
......\src\server\CS.java
......\...\......\Server.java
......\user.txt
......\build\classes\server
......\.....\generated-sources\ap-source-output
......\.....\classes
......\.....\empty
......\.....\generated-sources
......\nbproject\private
......\src\server
......\build
......\dist
......\nbproject
......\src
Server