文件名称:QQ
-
所属分类:
- 标签属性:
- 上传时间:2014-06-28
-
文件大小:6.91kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
本程序是基于TCP/IP协议的网络通信程序,运用了Java的流、文件、多线程等编程技术。套接字对象在网络编程中扮演着重要的角色,该程序就是一个基于套接字技术编写的简单聊天工具。聊天功能所使用的输入输出流分别是BufferedReader和PrintWriter,服务器为客户端启动一个线程,在该线程中通过套接字和客户交流信息。当向服务器发送一条聊天信息:“Hello”时,服务器要向这个线程中的输出流写入信息:“Hello”,那么客户端套接字的输入流就读取到了这条消息。文件传输分为文件发送和文件接收两部分,当服务器端要向客户端发送文件时,先调用字节输入流FileInputStream从本机读取想要发送的文件,再将信息通过字节输出流BufferedOutputStream发送到客户端,这样客户端的字节输入流BufferedInputStream就读取到了相应信息,客户端再通过字节输出流FileOutputStream将信息以文件形式存入本机。-This program is based on network communication program TCP/IP protocol, the use of Java streams, files, and other multi-threaded programming techniques. Socket object plays an important role in network programming, the program is written in a simple socket-based chat tool technology. Input and output streams chat are used BufferedReader and PrintWriter, the server for the client to start a thread in the thread through the socket and customers to exchange information. When sending a chat message to the server: " Hello" , the server would like this thread output stream to write information: " Hello" , then the client socket input stream is read to this message. File transfer files sent and received document is divided into two parts, when the client would like the server to send the file, byte input stream FileInputStream first call to read the file you want to send from the machine, then the information output by the byte stream BufferedOutputStream sent to the client, s
(系统自动生成,下载前可以参看下载内容)
下载文件列表
QQ.java
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.