【正文】
.............................................. 1 Abstract ............................................................................................................................ 1 第一章:緒論 ................................................................................................................... 3 什么是網(wǎng)絡編程 .................................................................................................. 3 優(yōu)點 ................................................................................................................... 3 第二章 linux網(wǎng)絡聊天室設計思想 .................................................................................. 4 功能分析 ............................................................................................................ 4 總體設計 ............................................................................................................ 4 第三章 linux網(wǎng)絡聊天室工具概述 .................................................................................. 5 GCC ................................................................................................................... 5 GCC 簡介 ................................................................................................... 5 GCC 執(zhí)行過程 ............................................................................................ 5 GCC 基本使用方法 ..................................................................................... 5 GNU Makefile........................................................................................................ 6 Makefile簡介 ........................................................................................... 6 Makefile 規(guī)則 ............................................................................................. 7 GDB 調(diào)試 ............................................................................................................ 7 用 gdb 調(diào)試 GCC 程序 ............................................................................... 7 第四章 關鍵技術分析 ...................................................................................................... 8 linux 線程間通信 .................................................................................................. 8 .................................................................................................... 8 .................................................................................................... 8 線程數(shù)據(jù)處理 ............................................................................................ 9 基于 linux 的 socket 網(wǎng)絡編程 ............................................................................... 9 端口和套接口 ............................................................................................ 9 套接字和套接口地址結 構 ........................................................................ 10 基本轉換函數(shù) .......................................................................................... 11 socket()和 bind()函數(shù) ....................................................................... 12 listen()和 accept()函數(shù) ..................................................................... 12 socket 中 TCP 的三次握手建立連接詳解 ..................................................... 13 、 socket 中 TCP 的四次握手釋放連接詳解 ......................................................... 14 第五章 linux下 socket編程實現(xiàn)過程 ........................................................................... 15 3 聊天室 socket 編譯鏈接過程 .............................................................................. 15 具體操作 .......................................................................................................... 16 參考文獻: .................................................................................................................... 18 附錄 ............................................................................................................................... 18 附錄 A: ............................................................................... 18 附錄 B: ................................................................................. 23 附錄 C: ................................................................................................. 26 附錄 D: .................................................................................................... 27 致謝 ............................................................................................................................... 30 第一章:緒論 什么是 網(wǎng)絡編程 網(wǎng)絡編程就是 通過使用套接字來達到進程間通信目的編程 。 關鍵字: TCP/IP; linux; socket Design and Implementation of Inter chat rooms under Linux Linren Ming Of Computer Science, Communication Engineering 2021 Instructor: Yue Miao Abstract: This system uses a bination of C / S structure, between the client and the client and customer client and serverside through the TCP / IP protocolbased Socket sets of interfaces to deliver messages. Used in server design and implementation of multithreading technology, in a single program which is running a number of different threads to perform different tasks. Greatly enhanced the program on the use of server resources. To write and debug serverside program and client program under Linux, the connection between the client, server and munications. Two windows can be opened up on a standalone client and server, or the two hosts links, respectively, as the client and server. Overall, this design embedded C language for the development of language, the use of work sockets 2 socket connection is established and run multithreaded data exchange program GCC debugging can be used in standalone work. Keywords: TCP / IP。 可以在單機上開辟兩個窗口實現(xiàn)客戶端和服務器,或者兩臺主機鏈接分別作為客戶端和服務器。大大增強了程序對服務器資源的利用。 1 Linux 下 網(wǎng)絡聊天室的設計與實現(xiàn) 林仁明 計算機學院通信工程專業(yè) 2021 級 指導老師:岳淼 摘要 : 本 系統(tǒng)采用 C/S 結合的結構 ,客戶端與客戶端以及客戶端與服務器端之間 通過 基于 TCP/IP 協(xié)議 Socket 套接口 傳送消息。服務器設計與實現(xiàn)過程中 采用了多線程技術,可以在單個程序當中同時運行多個不 同的線程