【正文】
I 【 摘 要 】 隨著互聯(lián)網(wǎng)的快速發(fā)展,網(wǎng)絡(luò)聊天已經(jīng)成為人們?nèi)粘=涣鳒贤ǖ牟豢苫蛉钡姆绞剑苁苋藗兊那嗖A。同時(shí)國(guó)內(nèi)外也出現(xiàn)了很多非常不錯(cuò)的聊天工具,其中應(yīng)用比較廣泛的有騰訊 、微軟 skype等等。本系統(tǒng)使用 JAVA語(yǔ)言并基于 C/S模式進(jìn)行開發(fā)。通過(guò) Socket建立服務(wù)器與客戶端間的 TCP 連接,服務(wù)器讀取、轉(zhuǎn)發(fā)客戶端發(fā)來(lái)信息,并刷新用戶列表。用流程圖的方式對(duì)系統(tǒng)使用中的注冊(cè)、登錄、發(fā)送信息等過(guò)程進(jìn)行分析,用直接繼承Thread 類來(lái)實(shí)現(xiàn)多線程,用 TCP/IP 協(xié)議進(jìn)行客戶端與服務(wù)器端的通信,并使用網(wǎng)絡(luò)編程的常用技術(shù)和一 些軟件工程的基本方法來(lái)完成聊天子系統(tǒng)和文件子系統(tǒng)的設(shè)計(jì)研發(fā)。在分析聊天系統(tǒng)的具體情況后,本系統(tǒng)采用 Eclipse 為基本開發(fā)環(huán)境并使用 java 語(yǔ)言進(jìn)行編寫,首先可在短時(shí)間內(nèi)建立系統(tǒng)應(yīng)用原型,然后,對(duì)初始原型系統(tǒng)進(jìn)行不斷修正和改進(jìn),直到形成可行的系統(tǒng)。 【 關(guān)鍵詞 】 局域網(wǎng) 聊天 Socket JAVA II Design and Implementation of Chat System based on C/S model 【 Abstract】 Along with the fast development of Inter, work chat has bee indispensable to People39。s Daily munication, is very popular with the people . At the same time also appeared a lot of very good chat tools at home and abroad, is widely used in it have Tencent 、 Skype and so on. This system is mainly based on the JAVA language and C/S mode of development. The server is established through the Socket, the server can read and deliver the information which client side sends, and can renovate the users tabulation. With the LAN correspondence mechanism principle, through inheriting the Thread kind to establish the multithreading directly. In the development, it uses the elementary theory knowledge which the puter work programme for example, TCP/IP agreement, Client/Server pattern, work programming design method and so on. In the work programming, it realizes reading and transmission of the information, that is,information flows realize the information exchange, introduce information flow analysis for realizing a system, in which contains some basic software engineering methods. After analyzes these situations, this system takes Eclipse as the basic development environment and piles in java language. first, it will establish the system application prototype in a short time. then, for the initial prototype system, it needs constantly revised and improved, until a viable system. 【 Keywords】 LAN Chat Socket JAVA III 目 錄 第一章 緒論 ............................................................................................................................. 1 課題來(lái)源 ........................................................................................................................ 1 國(guó)內(nèi)外現(xiàn)狀 .................................................................................................................... 1 研究的目的及意義 ........................................................................................................ 2 第二章 需求分析 ..................................................................................................................... 3 系統(tǒng)定義 ........................................................................................................................ 3 可行性分析 ..................................................................................................................... 3 功能需求 ........................................................................................................................ 3 數(shù)據(jù)需求 ........................................................................................................................ 5 用戶界面要求 ................................................................................................................ 5 第三章 數(shù)據(jù)庫(kù)設(shè)計(jì) ................................................................................................................... 8 數(shù)據(jù)庫(kù)的概念 ................................................................................................................ 8 數(shù)據(jù)庫(kù)的選擇 ................................................................................................................ 8 數(shù)據(jù)庫(kù)表的描述 ............................................................................................................ 8 第四章 技術(shù)介紹 ................................................................................................................... 12 JAVA 開發(fā)語(yǔ)言的選擇 ................................................................................................. 12 MVC 設(shè)計(jì)模式 ............................................................................................................... 13 多線程簡(jiǎn)介 .................................................................................................................. 15 SQL 語(yǔ)言 ....................................................................................................................... 15 TCP/IP 協(xié)議 ................................................................................................................. 16 Socket 的簡(jiǎn)介 ............................................................................................................. 17 第五章 系統(tǒng)實(shí)現(xiàn) ..................................................................................................................... 19 總體設(shè)計(jì) ....................................................................................................................... 19 具體設(shè)計(jì) ....................................................................................................................... 20 第六章 結(jié)論 ........................................................................................................................... 43 致 謝 ......................................................................................................................................... 44 參考文獻(xiàn) ..................................................................................................................................... 45 附錄 數(shù)據(jù)庫(kù)連接 ..................................................................................................................... 46