文档介绍:基于Socket的网络聊天系统开发与设计
摘要
近年来随着计算机技术的飞速发展,技术的发展,已经深刻的改变到了人们生活的方方面面。这时过去的种种陈旧的通讯方式,都已经不能满足现代生活的需要。人们希望能够用更低廉的价格,更加方便快捷的方式,来实现即时通讯。技术的网络聊天系统变得尤为重要。
本人以基于Java语言开发的网络聊天系统为实践基础,详细的介绍了聊天系统的功能设计和界面逻辑结构。最终实现了一个可以实现私聊、群聊、传送文件的网络聊天系统。本次设计主要以Socket网络通讯作为基础,并以Object作为通讯载体,同时运用了一定的通讯协议知识开发完成。在界面方面,采用的是Java中的Swing技术来实现。为了实现多用户的连接,在服务器端将采用多线程的技术来实现。
关键词:Java Socket 通讯协议 Swing 多线程
Socket-based web chat system development and design
Abstract
Recent years, with the rapid development puter technology, especially technology, has profound change to all aspects of people's lives. At this time all the old past, means munication, have been unable to meet the needs of modern life. People want to use more low cost, more convenient and efficient way to achieve real-munications. Then develop work based on technology, chat system es particularly important.
I developed Java-based chat system based on practice, detailed description of the chat function of the system design and interface, logical structure. Ultimately can achieve a whisper, group chat, send files online chat system. This design mostly munication as the basis, and with Object as munication carrier, while the use of a certain protocol plete the knowledge development. In the interface, the use of the Java in the Swing technologies. To achieve multi-user connection, the server will use the technology to implement multithreading.
Keywords:Java munication protocol Swing Multithreading
目录
4
课题背景 4
课题研究内容及意义 4
系统相关技术介绍 5
Java语言概述 5
TCP/IP协议 7
Socket编程 9
Swing简介 11
多线程技术介绍 12
15
需求分析 15
可行性分析 16
社会可行性 16
用户可行性 16
技术可行性 16
经济可行性 17
系统开发环境 17
18
客户端与服务器的通信 18
客户端与客户端的通信 18
系统的架构模式 19
四. 系统功能模块设计 20
服务器端的设计 20
服务器等待连接线程设计 20
服务器处理客户端信息线程设计 21
客户端设计 27
客户端登录模块设计 27
新用户注册模块设计 28
客户端主界面模块设计 28
点对点通信模块设计 29
一对多通信模块设计 29
点对点文件传输模块设计 30
五