河南理工大学本科生
毕业设计(论文)说明书
摘
要
JAVA语言是目前Internet上大型的WEB应用
程序开发时使用得最热门的编程语言,本文描述了JAVA技术的特点以及在互联网上的使用情况,介绍这种技术的重要编程方法,并以JAVA开发技术为核心的网上聊天
系统。本系统利用
Java实现基于C/S模式的聊天程序。聊天室共分为服务器端和客户端两部分,服务器端程序主要负责侦听客户端发来的消息,客户端需登录到服务端才可以实现正常的聊天功能。服务器端的主要实现:在特定端口上进行侦听,等待客户端连接;用户可以配置服务端的侦听端口,默认端口为8888;向已经连接到服务端的用户发送系统消息;统计在线人数;当停止服务时,断开所有的用户连接。客户端的主要功能为:连接到已经开启服务的服务端;用户可以配置要连接服务器端的IP地址与端口号;用户可以配置连接后显示的用户名;当服务器端开启的话,用户可以随时登录与注销;用户可以向所有人或某一个人发送消息。从而客户与客户之间以及客户与服务器之间可以简单方便地进行
通信。主要使用Sun公司提供Java语言、jdk开发环境及套接字通信socket技术,完成了对服务器端和客户端之间相互交流功能的实现。关键词:JAVA,SOCKET,JAVA聊天室
I
河南理工大学本科生毕业设计(论文)说明书
Abstract
TheJAVAlanguageisonpresentInternetwhenthelarge-scaleWEBapplicationproceduredevelopmentusedthemostpopularprogramminglanguage,thisarticledescribedtheJAVAtechnologycharacteristicaswellasonInternet'sservicecondition,introducedthatthiskindoftechnicaltheimportantprogrammingmethod,andon-linechattedthesystemtaketheJAVAdevelopmenttechnologyasthecore.ThissystemrealizesusingJavabasedontheC/Spatternchatstheprocedure.Thechatroomaltogetherdividesintotheserverendandtheclientsidetwoparts,thenewswhichtheserverendprocedureprimarycognizanceinterceptionclientsidesends,theclientsidemustregistertheserviceendonlythentobepossibletorealizenormallychatsthefunction.Theserverendmainrealizes:Carriesontheinterceptiononthespecificport,thewaitingclientsideconnection;Theusermaydisposetheserviceendtheinterceptionport,tacitlyapprovestheportis8888;T
oalreadyconnectedtheserviceendtheusertransmittingsystemnews;Countstheonlinepopulation;Whenthestopserves,separatesalluserconnection.Theclientsidemajorfunctionis:Connectedalreadyopenedtheservicetheserviceend;TheusermaydisposemustconnecttheserverendtheIPaddressandtheportnumber;Aftertheusermaydisposetheconnection,demonstrateduser;Whentheserverendopening
words,theusermaymomentarilyregisterwithloggingout;Theusermaytoallpeopleorsomeonesendingamessage.Thusbetweenthecustomerandthecustomeraswellasthecustomerandtheservermaycarryonthecorrespondenceconvenientlysimply.MainlyusesSunCorporationtoprovidetheJavalanguage,thejdkdevelopmentenvironmentandthesleevejointcharactercorrespondsthe