文档介绍:Linux下网络聊天室的设计与实现前面的各种介绍尽量简略一点,主要介绍该系统的设计和实现,比如需求分析、总体设计、详细设计等,多做一些图。还可以截一些图,代码作为附录放到最后。
林仁明
计算机学院通信工程专业2008级指导老师:岳淼
摘要: 本系统采用C/S结合的结构,客户端与客户端以及客户端与服务器端之间通过基于TCP/IP协议Socket套接口传送消息。服务器设计与实现过程中采用了多线程技术,可以在单个程序当中同时运行多个不同的线程执行不同的任务。大大增强了程序对服务器资源的利用。在Linux下编写并调试服务器端程序和客户端程序,实现了客户、服务器之间的连接和通信。可以在单机上开辟两个窗口实现客户端和服务器,或者两台主机链接分别作为客户端和服务器。总体来说,此设计以嵌入式C语言为开发语言,使用网络套接字socket建立连接,并运行多线程实现数据交换,调试成功,可以在单机网络中使用。
关键字:TCP/IP;linux;socket
Design and Implementation of chat rooms under Linux
Linren Ming
puter Science, Communication Engineering 2008 Instructor: Yue Miao
Abstract: This system uses bination of C / S structure, between the client and the client and customer client and server-side through the TCP / IP protocol-based Socket sets of interfaces to deliver messages. Used in server design and implementation of multi-threading 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 server-side program and client program under Linux, the connection between the client, server munications. Two windows can be opened up on a stand-alone 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 work sockets
socket connection is established and run multi-threaded data exchange program GCC debugging can be used in stand-work.
Keywords: TCP / IP; the linux; the socke
目录
摘要 1
Abstract 1
第一章:绪论 3
什么是网络编程 3
优点 3
第二章 linux网络聊天室设计思想 4
功能分析 4
总体设计 4
第三章 linux网络聊天室工具概述 5
GCC 5
GCC 简介 5
GCC 执行过程 5
GCC 基本使用方法 6
GNU Makefile 6
Makefile简介 6
Makefile 规则 7
GDB 调试 7
用gdb调试 GCC 程序 7
第四章关键技术分析 8
linux线程间通信 8
8
8
线程数据处理 9
基于linux的socket网络编程 9
端口和套接口 9
套接字和套接口地址结构 10
基本转换函数 11
socket()和bind()函数 12
listen()