后文附代码下载链接,代码经过调
试,可以正常使用
学
年
论
文
目 录
摘要................................................................ 1 Abstract............................................................ 2 第一章 绪论......................................................... 1
1.1 课题背景 .................................................... 1 1.2 研究现状 ................................................... 1 1.3 本文的主要工作 .............................................. 2 1.4开发平台及环境介绍........................................... 2 第二章 系统分析..................................................... 3
2.1功能要求..................................................... 3 2.2系统结构图................................................... 3 2.3 性能要求 ................................................... 4 第三章 系统设计..................................................... 6
3.1 数据库设计 .................................................. 6 3.2 服务器端软件结构 ............................................ 7 3.3 客户端软件结构 ............................................. 13 3.4 测试运行 ................................................... 16 总结............................................................... 17 参考文献........................................................... 18
西北师范大学08级计算机专业学年论文
摘 要
随着互联网的快速发展,网络聊天工具已经作为一种重要的信息交流工具,受到越来越多的网民的青睐。目前,出现了很多非常不错的聊天工具,其中应用比较广泛的有Netmeeting、腾讯QQ、MSN-Messager等等。该系统开发主要包括一个网络聊天服务器程序和一个网络聊天客户程序两个方面。前者通过Socket套接字建立服务器,服务器能读取、转发客户端发来信息,并能刷新用户列表。后者通过与服务器建立连接,来进行客户端与客户端的信息交流。其中用到了局域网通信机制的原理,通过直接继承Thread类来建立多线程。开发中利用了计算机网络编程的基本理论知识,如TCP/IP协议、客户端/服务器端模式(Client/Server模式)、网络编程的设计方法等。在网络编程中对信息的读取、发送,是利用流来实现信息的交换,其中介绍了对实现一个系统的信息流的分析,包含了一些基本的软件工程的方法。经过分析这些情况,该局域网聊天工具采用Eclipse为基本开发环境和java语言进行编写,首先可在短时间内建立系统应用原型,然后,对初始原型系统进行不断修正和改进,直到形成可行系统
1
西北师范大学08级计算机专业学年论文
Abstract
With the rapid development of Internet, network chat tool has been used as an important tool for information exchange, a growing number of Internet users of all ages. At present, there are many very good chat tools, which is widely used in Netmeeting, Tencent QQ, MSN-Messager and so on. 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 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, until forming the feasible system.
2
西北师范大学08级计算机专业学年论文
第一章 绪论
1.1 课题背景
随着互联网逐步普及,人们的生活和工作也越来越离不开信息网络的支持, 而聊天室是人们最常见, 最直接的网上交流的方式。本聊天系统以聊天交流为主,为广大用户提供一个借助网络进行人际交往的平台,也是网络与现实最贴近的实用型网站。本文所介绍的C/S聊天系统是基于开放的JAVA应用程序开发设计的,其主要特性是能动态、实时的完成信息的传递,且具有高效的交互性,更有效的处理客户请求,易于维护和更新,其运行所需环境及其工作流程和各个功能控件的工作原理将在本文依次介绍,并且文中提供了部分程序源代码。本文中将讨论一种基于Socket的即时通讯工具的设计与实现方法。
1.2 研究现状
即时通讯软件属于娱乐型软件,它已经是众多网民的必备软件。即时通讯软件是通过即时通讯技术来实现在线聊天、交流的软件。目前有2种架构形式,1、一种是C/S架构,采用客户端/服务器形式,用户使用过程中需要下载安装客户端软件,典型的代表有:QQ、百度HI 、Skype QQ VS GU、Gtalk、新浪UC、MSN等;2、采用B/S架构,即浏览器/服务端形式,这种形式的即时通讯软件,直接借助互联网为媒介、客户端无需安装任何软件,既可以体验服务器端进行沟通对话,一般运用在电子商务网站的服务商,典型的代表有Websitelive 、53KF、live800等。
1