-1-本科毕业论文(毕业设计)题目:局域网聊天软件系院:学生姓名:学号:专业:年级:完成日期:指导教师:-2-摘要在网络越来越发达的今天,人们对网络的依赖越来越多,越来越离不开网络,由此而产生的聊天工具越来越多,例如,国外的ICQ、国内腾讯公司开发的OICQ。基于Java网络编程的强大功能,本次毕业设计使用Java编写一个聊天系统。一般来说,聊天工具大多数由客户端程序和服务器程序外加服务器端用于存放客户数据的数据库组成,本系统采用客户机/服务器架构模式通过Java提供的Socket类来连接客户机和服务器并使客户机和服务器之间相互通信,由于聊天是多点对多点的而Java提供的多线程功能用多线程可完成多点对多点的聊天,数据库管理系统用SQLServer2000完成并通过JDBC-ODBC桥访问数据库。本系统建立在JAVA平台上,系统的设计使用了面向对象技术和面向对象的设计原则。系统采用C/S结构,客户端与客户端以及客户端与服务器端之间通过Socket传送消息。使用JAVA语言编写,开发工具采用Eclipse。服务器端设计与实现过程中,采用了多线程技术,可以在单个程序当中同时运行多个不同的线程,执行不同的任务。大大增强了程序对服务器资源的利用。聊天系统完成后将可进行多人对多人的聊天,对好友进行添加、删除,对新用户的注册,发送消息、接受消息等等功能。关键字:多线程;客户机/服务器;JAVA;Socket;Eclipse;TCP/IP-3-Abstractasthenetworkbecomemoreandmoredeveloped,peoplebecomemoreandmoreleantothenetwork,andcannotleavewithoutit.Thiscausedthechatmaterialsbecomemorenumerous,astheoverseasICQsystem,theOICQsystemthatinventedbyTencentCo.,andsoon.SowecreateanetworkchatmediumjustliketheQQ.Javanetworkprogrammingbasedonthepower,theuseofJavadesignedtopreparegraduatesachatsystem.Ingeneral,themajorityofthechattoolforclientandserverprograminadditiontoserver-sidestorageofcustomerdataforthedatabase,thesystemusesaclient/serverarchitecturemodeltheadoptionofJavaprovidedSocketclassconnectclientandserverandbetweentheclientandservercommunicatewitheachother,asthechatistoprovidepoint-to-multipointandmulti-threadedJavafunctiontobecompletedbyusingmulti-threadedchatandmorepoint-to-multipoint,databasemanagementsystemwithSQLServer2000thecompletionandadoptionofJDBC-ODBCBridgeaccessthedatabase.ThesystembuiltontheJAVAplatform,thesystemdesignusingobject-orientedtechnologyandobject-orienteddesignprinciples.SystemusestheC/Sstructure,clientandclient-sideandserver-sideclientandsendmessagesthroughSocket.TheuseofJAVAlanguage,developmenttoolsusingEclipse.DesignandImplementationofserver-sideprocess,theuseofmulti-threadingtechnology,whichcanprocessinasinglerunatthesametimeanumberofdifferentthreads,the-4-implementationofdifferenttasks.Proceduresgreatlyenhancedtheuseofserverresources.Chatsystemwillallowpeopletocompletechattomorefriends,andthesystemcanadd,deletesomebody,candealwithnewuserregistration,sendmessages,receivemessagesandsoon.Keywords:Multithreading;Client/Server;JAVA;Socket;Eclipse;TCP/IP目录-5-1绪论............................................................................................................错误!未定义书签。1.1国内外聊天系统的研究现状..................................................................-6-1.2JAVA语言..................................................................................................-9-1.2.1Java的发展历史...............................................................................-9-1.2.2Java的特点.......................................................................................-9-1.2.3Java与Internet................................................................................-11-1.3SOCKET编程...........................................................................................-12-1.3.1关于TCP/IP协议...........................................................................-12-1.3.2服务器和客户机....................................................错误!未定义书签。1.4本文内容安排........................................................................................-14-2需求分析...........................................................................................................................-15-2.1可行性研究..................................................................错误!未定义书签。2.1.1可行性分析.....................................................................................-15-2.1.2系统功能需求..................................................................................-16-2.1.3系统性能需求.................................................................................-16-2.1.4系统运行需求...............................................................................-17-2.2数据流图...............................................................................................-17-2.2.1顶层数据流图.................................................................................-17-2.2.2一层数据流图...............................................................................-18-2.2.3二层数据流图...............................................................................-19-3概要设计...........................................................................................................................-20--6-3.1系统实现原理........................................................................................-20-3.2系统实现层次图:..............................................................................-22-3.3各模块详细功能....................................................................................-22-3.3.2服务器端结构..................................................................................-22-3.3.2客户端结构.....................................................................................-23-4详细设计...........................................................................................................................-25-4.1系统流程图...............................................................