基于JAVA即时通讯系统 下载本文

分类号:TP393.09 U D C:密 级:公 开 编 号:

。。。。大学 学位论文

即时聊天系统设计实现

论文作者姓名: 申请学位专业: 申请学位类别: 指导教师姓名(职称): 论文提交日期:

、 通信工程 工学学士 。。。(教授)

即时聊天系统设计实现

摘 要

计算机网络技术在过去的四十年里获得了飞速发展,网络在人们的日常生活中扮演着越来越重要的角色,而网络即时聊天(IM,InstantMessaging)是人们网络生活中的主要活动之一,一款优秀的网络聊天软件应当具有占用资源小、界面友好、功能完善、简单易用等特点。如今的网络即时聊天工具有很多,知名的如QQ、MSN等等。

本文旨在设计一种网络即时聊天工具,系统采用基于服务器的客户端/服务器(Client/Server)结构模式;鉴于JAVA的强大网络编程性能,采用面向对象的JAVA语言作为开发语言;以Socket类来实现客户端和服务器之间的信息交换;以Java提供的多线程功能来实现多点对多点的聊天,增强了程序对系统资源的利用;开发工具使用MyEclipse。

最终完成的IM工具可以实现文字聊天、文件传输、添加和删除好友以及系统消息发送等等功能。

关键词:Java;Client/Server;Socket;多线程;TCP/IP

The Design and Realization of IM System

Abstract

Computer network technology won the rapid development of the network over the past four decades, network plays an increasingly important role in people's daily life, and instant messaging is one of the main activities in people`s network life , a good instant messaging software should have a small footprint, friendly interface, complete functions, easy to use and so on. Today's networks have a lot of instant messaging tools, known as QQ, MSN and so on.

This paper aims to design a instant chat tool, the system uses a server-based Client/Server structure model; Given strong network of JAVA programming performance, object-oriented JAVA language as a development language; to Socket class to implement the client and server exchange of information between; multithreading in Java provides features to achieve multi-point chat, enhanced the program for utilization of system resources; development tools to use MyEclipse.

The finished IM tools can achieve a text chat, file transfer, voice chat, add, delete friends, and system messages and more.

Key words: Java;Client/Server;Socket;Multithreaded Programming;

TCP/IP

目 录

论文总页数:30页

1 绪论....................................................................... 1

1.1 课题背景 ............................................................. 1 1.2 发展概况 ............................................................. 1 1.3 课题研究意义 ......................................................... 2 1.4 本文结构安排 ......................................................... 2 2 理论技术介绍 ............................................................... 2

2.1 Java语言 ............................................................ 2

2.1.1 Java的历史和演变 .............................................. 2 2.1.2 Java的关键特性 ................................................ 3 2.2 C/S结构 ............................................................. 3 2.3 Socket套接字 ........................................................ 4

2.3.1 TCP/IP和UDP ................................................... 4 2.3.2 Socket基本含义 ................................................ 5 2.3.3 Socket工作过程 ................................................ 5 2.4 多线程编程 ........................................................... 6 3 系统分析 ................................................................... 7

3.1 系统实现原理 ......................................................... 7 3.2 系统开发目标 ......................................................... 7 3.3 系统需求分析 ......................................................... 8

3.3.1 业务需求 ....................................................... 8 3.3.2 用户需求 ....................................................... 8 3.3.3 功能需求 ....................................................... 8 3.4 技术需求 ............................................................. 9

3.4.1 开发工具和技术 ................................................. 9 3.4.2 软硬件环境 ..................................................... 9

4 系统概要设计 ............................................................... 9

4.1 系统总体架构设计 ..................................................... 9 4.2 系统流程分析 ........................................................ 10

4.2.1 客户端流程分析 ................................................ 10 4.2.2 服务器端流程分析 .............................................. 10 4.3 客户端功能模块分析 .................................................. 11

4.3.1 注册模块 ...................................................... 12