【正文】
0。 用戶退出后應(yīng)該把用戶從在線列表中刪除,否則用戶退出用戶還在在線列表中,那么該用戶下次將會(huì)無法登錄。 log(用戶 + + 已經(jīng)退出 , + 退出時(shí)間 : + ())。 public void serverChat() { // 將接收到的對(duì)象值賦給聊天信息的序列化對(duì)象 Chat cObj = new Chat()。 toServer = new Socket(strServerIp,1001)。 ()。 // 讀來自服務(wù)器 socket的登錄狀態(tài) BufferedReader fromServer = new BufferedReader( new InputStreamReader(()))。 ()。 // 發(fā)送 按鈕 public void sendMessage() { Chat chatobj = new Chat()。 (chatobj)。 (())。 String st。//填充的矩形 ()。 //計(jì)算時(shí)間和圖形的關(guān)系 sdo=90ss*6。 old_Y=y。 // fileString += (line + \n)。 = strLoginName。 } catch (Exception e) { } private void exitChatRoom() { exit()。根據(jù)實(shí)現(xiàn)的情況看,具有較友好的聊天界面生成效果,以及流暢的網(wǎng)絡(luò)通信效果。 一個(gè)月的忙碌和工作,本次畢業(yè)設(shè)計(jì)已經(jīng)接近尾聲,作為一個(gè)??粕漠厴I(yè)設(shè)計(jì),由于經(jīng)驗(yàn)的匱乏,難免有許多考慮不周全的地方,如果沒有導(dǎo)師的督促指導(dǎo),以及一起工作的同學(xué)們的支持,想要完成這個(gè)設(shè)計(jì)是難以想象的。并 在用戶查看后退出客戶端。 // 向服務(wù)器發(fā)送信息 ObjectOutputStream outObj = new ObjectOutputStream(toServer .getOutputStream())。 // (fileString)。 //繪制時(shí)針 line(g,hdo,(int)(r*),)。 我們的愛情,我們的理想,我們的未來,我們的成長,我們的幸福 我們的愛情,我們的理想,我們的未來,我們的成長,我們的幸福 hdo=90hh*30mm/2。 else st=+hh。 //繪制圓形 ????? ??????????????? //獲取時(shí)間 Calendar now=()。 (null, 聊天記錄保存在 + + )。 // 清空文本框 ()。 = ()。 ()。 if ((登錄成功 )) { new ChatRoom((String) , strServerIp)。 ()。 //寫客戶詳細(xì)資料到服務(wù)器 socket ((Register_Customer)data)。 // chenmin = ()。 } 接收用戶聊天信息 當(dāng)用戶發(fā)送聊天信息時(shí),服務(wù)端將會(huì)收到客戶端用 Socket 傳輸過來的聊天信息對(duì)象,然后將其強(qiáng)制轉(zhuǎn)換為 Chat 對(duì)象。否則用戶數(shù)據(jù)將會(huì)不同步。 a++) { String _custName = ((Customer) userOnline .elementAt(a)).custName。 ObjectInputStream objInput1 = new ObjectInputStream(file3)。 (vList)。 } else if ((所有人 )) { (禁止使用此注冊(cè)名 ,請(qǐng)另外選擇 )。 if (() != 0)// 判斷是否是第一個(gè)注冊(cè)用戶 { ObjectInputStream objInput = new ObjectInputStream( new FileInputStream(fList))。 我們的愛情,我們的理想,我們的未來,我們的成長,我們的幸福 我們的愛情,我們的理想,我們的未來,我們的成長,我們的幸福 解決方案 后臺(tái)數(shù)據(jù)庫設(shè)計(jì) 基于服務(wù)器跨平臺(tái)運(yùn)行的構(gòu)想,服務(wù) 器的后臺(tái)數(shù)據(jù)庫使用了 SQL Server2020。 Windowclose 為 的內(nèi)部類,負(fù)責(zé)監(jiān)聽聊天室界面的操作,當(dāng)用戶退出時(shí)返回給服務(wù)器信息。 為服務(wù)器端啟動(dòng)界面,負(fù)責(zé)監(jiān)聽服務(wù)器的狀態(tài),在線人數(shù),最多在線人數(shù),服務(wù)器名稱,訪問協(xié)議,服務(wù)器 IP,服務(wù)器端口以及用戶信息的管理,日志的保存。 安裝使用簡(jiǎn)便:服務(wù)器端的安裝簡(jiǎn)潔明 了,客戶機(jī)無需再裝任何軟件就可以直接注冊(cè)登陸聊天。 系統(tǒng)功能需求 本系統(tǒng)主要通過客戶端,服務(wù)器端來體現(xiàn)聊天系統(tǒng)的基本功能。 第三章為概要設(shè)計(jì),分模塊介紹系統(tǒng)的具體實(shí)現(xiàn)過程。一 旦連通,就變成了一種雙向通信,誰來扮演服務(wù)器或者客戶機(jī)便顯得不那么重要了。接著,客戶端為了表示收到了這 個(gè) SYN+ACK 信息,會(huì)向服務(wù)器發(fā)送一個(gè)最終確認(rèn)信息( ACK 包)。 Java 的字節(jié)碼需要經(jīng)過 Java 虛擬機(jī) JVM 解釋成機(jī)器碼才能執(zhí)行,所以速度上較慢。 3. 安全性 Java 是可以用在網(wǎng)路及分布環(huán)境下的網(wǎng)路程序設(shè)計(jì)語言。 為了解決此類問題, Gosling 決定開發(fā)一種新的語言,并取名為 Oak。當(dāng)時(shí) Sun Microsystem 公司為了發(fā)展消費(fèi)類電子產(chǎn)品進(jìn)行了一個(gè)名為 Green 的項(xiàng)目計(jì)劃。 參考了許多網(wǎng)絡(luò)上的資料,以及自己通過觀察騰訊 運(yùn)行時(shí)的各種細(xì)節(jié)。TCP/IP 我們的愛情,我們的理想,我們的未來,我們的成長,我們的幸福 我們的愛情,我們的理想,我們的未來,我們的成長,我們的幸福 目 錄 1 緒論 ................................................................................................................. 錯(cuò)誤 !未定義書簽。服務(wù)器端設(shè)計(jì)與實(shí)現(xiàn)過程中,采用了多線程技術(shù),可以在單個(gè)程序當(dāng)中同時(shí)運(yùn)行多個(gè)不同的線程,執(zhí)行不同的任務(wù)?;?Java 網(wǎng)絡(luò)編程的強(qiáng)大功能 , 本 次畢業(yè)設(shè)計(jì)使用 Java 編寫一個(gè)聊天系統(tǒng)。 關(guān)鍵字 : 多線程 ; 客戶機(jī) /服務(wù)器 ; JAVA ; Socket ; Eclipse ; TCP/IP 我們的愛情,我們的理想,我們的未來,我們的成長,我們的幸福 我們的愛情,我們的理想,我們的未來,我們的成長,我們的幸福 Abstract as the work bee more and more developed, people bee more and more lean to the work, and can not leave with out it. This caused the chat materials bee more numerous, as the overseas ICQ system, the OICQ system that invented by Tencent Co., and so on. So we create a work chat medium just like the . Java work programming based on the power, the use of Java designed to prepare graduates a chat system. In general, the majority of the chat tool for client and server program in addition to serverside storage of customer data for the database, the system uses a client / server architecture model the adoption of Java provided Socket class connect client and server and between the client and server municate with each other, as the chat is to provide pointtomultipoint and multithreaded Java function to be pleted by using multithreaded chat and more pointtomultipoint, database management system with SQL Server2020 the pletion and adoption of JDBCODBC Bridge access the database. The system built on the JAVA platform, the system design using objectoriented technology and objectoriented design principles. System uses the C / S structure, client and clientside and serverside client and send messages through Socket. The use of JAVA language, development tools using Eclipse. Design and Implementation of serverside process, the use of multithreading technology, which can process in a single run at the same time a number of different threads, the implementation of different tasks. Procedures greatly enhanced the use of server resources. Chat system will allow people to plete chat to more friends, and the system can add, delete somebody, can deal with new user registration, send messages, receive messages and so on. Keywords : Multithreading 。 可行性分析 ..................................................................................... 10 系統(tǒng)功能需求 ..........................................