Description: 拥有客户端和服务器的网络聊天程序,可以群聊,也可以私聊,还可以发送和接受文件,是一款功能比较强的程序。-Client and server has a network chat program, you can group chat can also be私聊, you can send and receive documents, is a relatively strong function of the procedure. Platform: |
Size: 1178624 |
Author:qin |
Hits:
Description: 本案例是一个网络聊天工具的实现,提供了基本的聊天的功能,通过此例能学习到如何利用Socket建立服务器程序和客户端程序以及关于多进程间调度等方面的知识-This case is a network chat tool, providing the basic chat functions, through this case study into how to set up Socket server and client procedures and processes regarding many aspects of scheduling knowledge Platform: |
Size: 97280 |
Author:张洪铭 |
Hits:
Description: 聊天程序,一个服务器程序,一个客户端程序,很简单,可运行-Chat program, a server program, a client program, very simple to run Platform: |
Size: 8733696 |
Author:yy |
Hits:
Description: 聊天室的实现要实现客户端(cilent)和服务端(server),客户端(client)和服务端(server)通过Socket建立必要的连接。并让服务端(server)程序监听一个众所周知的端口。当客户端(client)的连接请求到达时,如果服务端(server)同意建立连接,则将创建一个新的Soket并绑定到另一个端口,使用这个新建的Socket与该客户端(client)建立连接,而服务端(server)继续在与原来的端口监听,等待新的连接请求。
当连接建立后,通过输入/输出流并通过这些流进行数据的传输。
当两个主机之间的通信结束时,则要关闭连接。关闭连接通过关闭Socket可以调用Socket类的close()方法。其中应该先将与Socket相关的所有输入/输出流关闭,最后在关闭Socket。
建立一个ChatClient类:该类中的createUI()方法实现的聊天界面 ,connect()方法实现端口的连接等;
2.建立一个ChatServer类:该类中服务端(server)应用程序采用多线程机制,可以支持客户端(client)的并发访问。-The realization of the chat room to achieve the client (cilent) and end (server) and client (client) and server (server) Socket establish the necessary connection.And let the server (server) listens on a well-known port. When the client (client) connection request arrives, the server (server) agreed to establish a connection, it will create a new Soket and bind to another port, the use of this new Socket and the client (client) to establish connected to the server (server) to continue with the original port listener, waiting for a new connection request.
When the connection is established, through the input/output streams and these streams of data transmission.
When the end of the communication between the two hosts, will have to close the connection. Close the connection by closing the Socket can call the close () method of the Socket class. Which should be first of all related with Socket input/output streams closed, and finally closed the Socket.
Establish a ChatClient class: Platform: |
Size: 10240 |
Author:lanyulin |
Hits: