freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于vc的網(wǎng)絡(luò)通信系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)-資料下載頁(yè)

2024-12-07 09:25本頁(yè)面

【導(dǎo)讀】域的限制,達(dá)到人與人之間的零距離交流,使得人們的溝通更加方便、快捷。前,全球約有近3億多人使用即時(shí)通訊軟件進(jìn)行交流。議的體系結(jié)構(gòu)等。然后詳細(xì)分析了系統(tǒng)的整體設(shè)計(jì),包括系統(tǒng)的功能介紹、實(shí)現(xiàn)思想,系。體程序結(jié)構(gòu)圖、流程圖、類圖、用例圖等。接下來(lái)就介紹了各個(gè)子模塊的功能、實(shí)現(xiàn)思。想及它們的流程圖、類圖、消息流框圖等。最后是系統(tǒng)的分析、優(yōu)缺點(diǎn)及系統(tǒng)的總結(jié)和

  

【正文】 yncSocket 類主要負(fù)責(zé)維護(hù)為客戶連接的數(shù)據(jù)套接 字 ,它包括下面的數(shù)據(jù)成員: CListCDataSocket*,CDataSocket* m_lstDataSock。 //數(shù)據(jù)套接字鏈表 和下面的方法成員: BOOL SendPackageToAll (char* buf, int buflen, CDataSocket* pFrom)。 //向所有(不 包括 pFrom)的活動(dòng)套接字發(fā)消息 BOOL CLoseDataSocket (CDataSocket* pSock)。 //關(guān)閉數(shù)據(jù)套接字 psock Void CloseAllSocks()。 //關(guān)閉所有套接字 在 CListenSocket 類中僅僅注冊(cè)了 FD_ACCEPT 網(wǎng)絡(luò)事件。數(shù)據(jù)收發(fā)的工作全部要由數(shù)據(jù)套接字完成。 CDataSocket 類 CDataSocket 類是數(shù)據(jù)套接字的 C++封裝,它派成自 CAsyncSocket 類。 CDataSocket類主要負(fù)責(zé)和客戶端套接字的通信工作。它包含下面一些方法成員: Void onReceivemessage()。 //接受客戶端 PACKET_MESSAGE 類型的數(shù)據(jù)包的處理函數(shù) Void onReceivelogout()。 //接受客戶端 PACKET_LOGOUT 類型的數(shù)據(jù)包的處理函數(shù) Void onReceiveLogin()。 //接收客戶端 PACKET_LOGIN 類型的數(shù)據(jù)包的處理函數(shù) CSeverlnfoDlg 類和 CAboutDlg 類 CSeverlnfoDlg 和 CAboutDlg類分別是程序中輸入服務(wù)器信息和顯示程序版權(quán)信息的對(duì)話框,它們運(yùn)行界面 分別 如圖 22 和圖 23 所示。 27 圖 22 CServerInfoDlg 的運(yùn)行界面 圖 23 CAboutDlg 的運(yùn)行界面 6 結(jié) 語(yǔ) 本 設(shè)計(jì) 是 在 軟件工程思想 的指導(dǎo)下 開(kāi)發(fā) 的 MFC socket 網(wǎng)絡(luò)程序。 MFC 及 Visual Studio IDE 為簡(jiǎn)化 Socket 編程做了大量的工作,特別是編碼部分。前面的協(xié)議開(kāi)發(fā)和類型、類的設(shè)計(jì)部分,是網(wǎng)絡(luò)通信程序開(kāi)發(fā)的方法和過(guò)程。 客觀的說(shuō), Chat 還 不 是一個(gè) 非常 完整的版本,這主要表現(xiàn)在: 1. Server 設(shè)計(jì)為重復(fù)服務(wù)器,在客戶連接數(shù)量多的時(shí)候 有 可能導(dǎo)致低效。 2. Server 的健壯性 相對(duì)來(lái)說(shuō)比較差 ,防錯(cuò)措施 不是很強(qiáng) ,尤其是在網(wǎng)絡(luò)條件 不是很理想 的環(huán)境下,程序可能出現(xiàn)意想不到的問(wèn)題。 3. 服務(wù) 器沒(méi)有使用數(shù)據(jù)庫(kù), 客戶端、服務(wù)器端都應(yīng)該 有相應(yīng)的配置文件。 4. 程序沒(méi)有加密數(shù)據(jù)包,數(shù)據(jù)傳輸安全性 比較 差。 5. 用戶界面的易用性有待提高。 參 考 文 獻(xiàn) [1] 吳功宜 . 計(jì)算機(jī)網(wǎng)絡(luò) .第二版 .北京:清華大學(xué)出版社, [2] 亓?xí)造o . 基于 C/S架構(gòu)的軟件項(xiàng)目實(shí)訓(xùn) .第一版 . 北京 : 電子工業(yè)出版社 , [3] Socket . [4] TCP/IP 參考模型 . [5] 龔正虎 . 計(jì)算機(jī)網(wǎng)絡(luò)協(xié)議工程 . 長(zhǎng)沙 : 國(guó)防科技大學(xué)出版社 .1993 [6] 魯士文 .計(jì)算機(jī)網(wǎng)絡(luò)原理與網(wǎng)絡(luò)技術(shù)北京機(jī)械業(yè)出版社 .1996 [7] 賈斌 . 網(wǎng)絡(luò)編程技巧與實(shí)例 .第四版 . 北京 : 人民郵電出版社 , [8] 郎銳,孫方 Visual C++ 網(wǎng)絡(luò)通信程序開(kāi)發(fā)基礎(chǔ)及實(shí)例解析 北京:機(jī)械工業(yè)出版社, [9] .*如何進(jìn)行 Socket 編程 . [10] 彭德中,曾翎 . 軟件工程 .第一版 .北京 : 高等教育出版社, [11] Jason . UML 基礎(chǔ)教程 .第一版 . 北京 :清華大學(xué)出版社 , [12] 郝蘊(yùn) . Vc++ .第一版 . 北京 : 電子工業(yè)出版社 , [13] . C++基礎(chǔ)教程 .第一版 . 北京 : 中國(guó)水利水電出版社 , [14] 嚴(yán)華鋒 . Vc++課程設(shè)計(jì)案例精編 .第二版 . 北京 :中國(guó)水利水電出版社 , [15] 李強(qiáng),賈云霞 . Vc++項(xiàng)目開(kāi)發(fā)實(shí)踐 .第一版 . 北京 : 中國(guó)鐵道出版社 , 29 The Design and Implemention of Network Communication by VC++ Li Haiying (College of Computer Science and Engineering, ZhongKai University of Agriculture amp。Engineering, GuangZhou, 510225, China) Abstract: The paper is about the design and realization of correspondence software. First this paper introduced topic origin and the topic significance, As well as the principle and the technology that adopted in the paper , Including Customer/Server (C/S) structure principle, TCP/IP protocol system structure and so on. Then author analyzes that the overall design, Including system function introduction, realization way, demand anal ysis, munication agreement design, system structure of each module. And adopting the UML technology, the author draws the overall procedure structure drawing, the flow chart, class drawing, and message flow chart and so on. Finally the paper introduced that the systematic analysis 、 the excellence and the disadvantage of the system , the summary and the forecast of the system. The terminal establishes the TCP munications through the actual correspondence link with the server. At the same time the server accepts and validates the connection of the client, dynamically manages the name list of the on- line users. Key words: the C/S Structure; the TCP/IP Protocol; the UML Technology 30 附 錄 服務(wù)器端 include ifdef _DEBUG define new DEBUG_NEW undef THIS_FILE static char THIS_FILE[] = __FILE__。 endif ///////////////////////////////////////////////////////////////////////////// // CDataSocket CDataSocket::CDataSocket(CAsyncSocket* pListenSock) { // m_pMainWnd = ((CListenSocket*)pListenSock)GetMainWnd()。 // 設(shè)定套接字選項(xiàng) LINGER linger。 = 1。 = 5000。 // 等待 5 秒 SetSockOpt(SO_LINGER, (void*)amp。linger, sizeof(linger), SOL_SOCKET)。 } CDataSocket::~CDataSocket() { } // Do not edit the following lines, which are needed by ClassWizard. if 0 BEGIN_MESSAGE_MAP(CDataSocket, CAsyncSocket) //{{AFX_MSG_MAP(CDataSocket) //}}AFX_MSG_MAP END_MESSAGE_MAP() endif // 0 31 ///////////////////////////////////////////////////////////////////////////// // CDataSocket member functions void CDataSocket::OnReceive(int nErrorCode) { if (nErrorCode != 0) { return。 } // 查看數(shù)據(jù)包類型 WORD type = 0。 if (Receive((void*)amp。type, sizeof(type), 0) != sizeof(type)) { TRACE0(unable to receive package type info.)。 return。 } switch (type) { case PACKAGE_LOGIN: // login infomation OnReceiveLogin()。 break。 case PACKAGE_LOGOUT: OnReceiveLogout()。 break。 case PACKAGE_MESSAGE: // message send to server OnReceiveMessage()。 break。 default: break。 } } void CDataSocket::OnReceiveLogin() { 32 LOGIN_INFO info。 if (Receive((void*)amp。info, sizeof(info), 0) != sizeof(info)) { TRACE0(unable to receive user login infomation.)。 return。 } // 你可以在這里檢測(cè)用戶名和密碼的正確性 , 為簡(jiǎn)單起見(jiàn) , 我們?cè)谶@里跳過(guò) // 向其 他用戶發(fā)送該用戶上線的消息 SOCKADDR_IN addrIn。 int addrLen = sizeof(SOCKADDR_IN)。 if (!GetPeerName((SOCKADDR*)amp。addrIn, amp。addrLen)) { TRACE0(Unable to get peer name.\n)。 return。 } USER_INFO userInfo。 memcpy(, , strlen() + 1)。 = 。 = 。 CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd()。 CServerDoc* pDoc = (CServerDoc*)pFrameGetActiveDocument()。 CServerView* pView = (CServerView*)pFrameGetActiveView()。 // 更新顯示 消息 CString strMsg。 (IDS_LOGIN, , i_ntoa(*(in_addr*)amp。), ntohs())。 pViewAppendMessage(strMsg)。 // 向登錄用戶發(fā)送在線人員列表 pDocSendUserListTo(userInfo, this)。 // 向所有用戶發(fā)送該用戶上線的消息 pDocAlterUser(PACKAGE_USERADD, amp。userInfo, this)。 33 } void CDataSocket::OnReceiveLogout() { // 獲取登出用戶的信息 USER_INFO info。 if (Receive(
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1