T论文分类号: TP 学校代码: 13681
毕业设计说明书(论文)
题目: 基于JAVA聊天室的设计与实现
学生姓名: 学 号: 系 部: 专业班级: 指导教师:
二〇一一年七月
I
Based on the Java Chat Room Design and Implementation
ABSTRACT
The rapid development of computer network technology, so that people can choose to communicate more and more the traditional means of communication in the velocity and reliability have been difficult to meet the needs of the people, the instant communication system has become one of the new favorites is an indispensable part. Instant communication refers to the release of information and information receiver almost at the same time to transfer requirements, a small delay system tools. Such as the commonly used QQ tools, web, MSN communication system tools.The system includes the development of a network chat server program and a network chat client program in two aspects. The former through the Socket establish a server, server can read, forwarded from client information, and can refresh the list of users. The latter by establish a connection with the server, to client and client information exchange. Which uses a local area network communication mechanism, through direct Thread class inheritance to create multiple threads. Development of the computer network programming to the basic knowledge, such as the TCP / IP protocol, client / server mode ( Client / Server mode), network programming design method. Network programming in the information read, send, is the use of flow to achieve information exchange, which is introduced to implement a systematic analysis of information flow, including some basic software engineering methods. Through the analysis of these cases, the LAN chat tools using Eclipse as the basic development environment and Java language preparation, first in a short period of time can build up the system application prototype, then, for the initial prototype system, revises and the improvement unceasingly, at the same time, multi-threading, task design, developed a stable performance, fully functional the server.
The complete implementation of the function of the system. Through this graduation design can be learned about the application and implementation of object-oriented methods, how to use the Eclipse integrated development environment to create and development projects, thus the complete realization of the function of the system.
KEY WORDS:Java chat room ,application program ,development environment
II
基于Java聊天室的设计与实现
摘 要
计算机网络技术的快速发展,使人们可选择的交流方式越来越多,传统的通信方式在速度和可靠性方面已经很难满足人们的需要,即时通信系统已成为人们的新宠也是人们生活中不可或缺的一部分。即时通信即指信息的发布者与信息的接收者几乎同时达到传送要求,延迟很小的系统工具。如常用的QQ工具,飞信,MSN等通讯系统工具。
该系统开发主要包括一个网络聊天服务器程序和一个网络聊天客户程序两个方面。前者通过Socket套接字建立服务器,服务器能读取、转发客户端发来信息,并能刷新用户列表。后者通过与服务器建立连接,来进行客户端与客户端的信息交流。其中用到了局域网通信机制的原理,通过直接继承Thread类来建立多线程。开发中利用了计算机网络编程的基本理论知识,如TCP/IP协议、客户端/服务器端模式(Client/Server模式)、网络编程的设计方法等。在网络编程中对信息的读取、发送,是利用流来实现信息的交换,其中介绍了对实现一个系统的信息流的分析,包含了一些基本的软件工程的方法。经过分析这些情况,该局域网聊天工具采用Eclipse为基本开发环境和Java语言进行编写,首先可在短时间内建立系统应用原型,然后,对初始原型系统进行不断修正和改进,同时,采用多线程、多任务的设计思想,开发出性能稳定,功能全面的服务器。完整的实现系统的功能。通过本次毕业设计可以学到如何应用和实现面向对象的各种方法,如何使用Eclipse集成开发环境来创建和开发项目,从而完整的实现整个系统的功能。
本系统结构设计合理,功能齐全,采用模块化设计、操作简单,具有良好的人机界面和灵活的系统可维护性;可以实现简单的功能如注册、登陆、查找好友、聊天等功能。并且服务端实现配置文件设置、用户管理、日志显示等功能。 关键词:聊天室,应用程序,开发环境
III
目 录
1引 言 ....................................................................................................................................... 1
1.1即时通讯技术概述 ....................................................................................................... 1 1.2目的和意义 ................................................................................................................... 2 2项目开发工具和技术选择 ..................................................................................................... 3
2.1开发工具 ....................................................................................................................... 3
2.1.1Java简介 .............................................................................................................. 3 2.1.2 MyEclipse6.0 开发工具 ..................................................................................... 3 2.2技术选择 ....................................................................................................................... 4
2.2.1 C/S结构 .............................................................................................................. 4 2.2.2 Java Socket技术 ................................................................................................. 4
3需求分析 ................................................................................................................................. 6
3.1项目概述 ....................................................................................................................... 6
3.1.1产品描述 ............................................................................................................. 6 3.1.2产品功能 ............................................................................................................. 7 3.2功能需求 ....................................................................................................................... 7
3.2.1用户注册 ............................................................................................................. 7 3.2.2用户登入 ............................................................................................................. 8 3.2.3一对一聊天 ......................................................................................................... 8 3.2.4发送表情 ............................................................................................................. 9 3.2.5用户退出 ............................................................................................................. 9 3.3质量性能需求 ............................................................................................................... 9 4概要设计 ............................................................................................................................... 11
4.1系统的代码结构 ......................................................................................................... 11 4.2主程序类的设计(MainWin类) .................................................................................. 11 4.3多线程的设计 ............................................................................................................. 11 4.4服务器端的设计 (Server类) ..................................................................................... 12 4.5消息通信的设计 ......................................................................................................... 12 5系统的实现 ........................................................................................................................... 14
5.1主程序类的实现 ......................................................................................................... 14 5.2多线程的实现 ............................................................................................................. 14 5.3服务器连接的实现 ..................................................................................................... 15
百度搜索“yundocx”或“云文档网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,云文档网,提供经典综合文库基于JAVA聊天室的设计与实现在线全文阅读。
最新更新: