![](https://csdnimg.cn/release/download_crawler_static/89636157/bg1.jpg)
分类号:TP311.1 U D C:D10621-408-(2007)5915-0
密 级:公 开 编 号:2003032027
成 都 信 息 工 程 学 院
学 位 论 文
一个简单的即时通讯工具的设计与开发
论 文 作 者 姓 名 :
寇建波
申 请 学 位 专 业 :
网络工程
申 请 学 位 类 别 :
工学学士
指导教师姓名(职称):
何林波
论 文 提 交 日 期 :
2007 年 06 月 10 日
![](https://csdnimg.cn/release/download_crawler_static/89636157/bg2.jpg)
一个简单的即时通讯工具的设计与开发
摘 要
即时通讯(Instant Messaging)是目前 Internet 上最为流行的通讯方式,
各种各样的即时通讯软件也层出不穷;服务提供商也提供了越来越丰富的通讯服
务功能。Java 是当前比较流行的开发语言之一,它有着自己的易用特点与性能
优势,比如跨平台、安全性、多线程、网络 Socket 编程、数据流概念等方面,
因此通过对开源即时通讯 LinuxQQ 的研究和分析,基于 Java 语言和 J2EE 规范设
计了一个即时通讯工具 JICQ (Java for I seek you),并对其体系结构、构成模块
及系统关键技术进行了分析与设计。在系统设计与建模过程中,使用了 UML 和面
向对象的分析、设计方法,并使用 Rose 作为建模工具;本系统基于 j2se1.5,
j2ee1.4,使用 Eclipse 等作为开发工具,在开发过程中用到了时下流行的重构
开发方法,优化了系统的设计。力图使系统具有安全、高效、实用、支持在不同
系统平台运行等特点。
关键词:即时通讯;多线程;SOCKET 编程;JSP
![](https://csdnimg.cn/release/download_crawler_static/89636157/bg3.jpg)
Design and Development of a Simple Instant
Communication Tool
Abstract
Instant Message is currently the most popular way to communicate on the
Internet,so various Instant Messaging software are continuously appearing; Service
providers offer more and more communication service nowadays. Java programming
language (Java 2 Standard Edition) is one of popular programming languages. With
its features of cross-platform, security, multi-threaded capability, Socket
Programming, data flow concepts and so on, Java has its own distinctive and
functional advantages. Therefore, based on the research and analysis of LinuxQQ,
with the Java language and J2EE, this paper designs an instant messenger—JICQ
(Java for I seek you), and then analyzes its architecture, modules, as well as its key
technologies. During the design and modeling process of instant messenger system,
the UML and method of object-oriented analysis and design are used. Furthermore,
the modeling tool of Rose is included. Based on the system j2se1.5, j2ee1.4, the
Eclipse development tool in the development process, and refactoring development
method, the system design is optimized. Due to these factors, the system is safe,
efficient and practical in different operating system platforms.
Key words: instant message; multithreaded; socket program; JSP
![](https://csdnimg.cn/release/download_crawler_static/89636157/bg4.jpg)
目 录
论文总页数:30 页
1 引言................................................................................................................................................1
1.1 项目开发背景 ........................................................................................................................1
1.1.1 项目背景........................................................................................................................1
1.1.2 技术背景........................................................................................................................1
1.2 该系统设计的意义 ................................................................................................................2
2 相关理论及基础技术与开发平台.................................................................................................2
2.1 即时通讯应用工作原理分析 ................................................................................................2
2.2 所用技术.................................................................................................................................3
2.3 工具及开发平台.....................................................................................................................4
2.4 系统配置要求 ........................................................................................................................5
3 系统体系结构的设计.....................................................................................................................5
3.1 需求描述 ................................................................................................................................5
3.2 系统架构设计.........................................................................................................................6
3.3 系统的总体功能设计 ............................................................................................................7
3.3.1 总体功能设计.................................................................................................................7
3.3.2 注册模块设计.................................................................................................................8
3.3.3 登录模块设计..............................................................................................................10
3.3.4 用户间交互模块设计...................................................................................................12
3.4 数据库设计...........................................................................................................................14
3.4.1 数据库物理模型...........................................................................................................14
3.4.2 数据字典.......................................................................................................................15
4 系统实现.......................................................................................................................................16
4.1 网络通讯编码实现...............................................................................................................16
4.1.1 聊天客户端部分代码...................................................................................................16
4.1.2 服务器端监听与转发消息代码...................................................................................17
4.1.3 服务端单线程上线处理代码.......................................................................................18
4.2 系统运行的效果图 ..............................................................................................................20
4.2.1 登录界面......................................................................................................................20
4.2.2 主界面..........................................................................................................................20
4.2.3 群聊天界面..................................................................................................................21
4.2.4 好友聊天界面..............................................................................................................22
4.2.5 好友查找界面..............................................................................................................23
![](https://csdnimg.cn/release/download_crawler_static/89636157/bg5.jpg)
4.3 注册模块的实现...................................................................................................................24
4.3.1 数据库连接..................................................................................................................24
4.3.2 字符编码过滤器的核心代码......................................................................................24
4.4 注册模块运行效果图 ..........................................................................................................25
4.4.1 主页面..........................................................................................................................25
4.4.2 注册页面......................................................................................................................25
5 系统测试与运行..........................................................................................................................26
结 论..........................................................................................................................................27
参考文献..........................................................................................................................................28
致 谢..........................................................................................................................................29
声 明..........................................................................................................................................30