# 服务器-客户端(聊天) **Repository Path**: smy0506/server-client-chat ## Basic Information - **Project Name**: 服务器-客户端(聊天) - **Description**: C语言编写的聊天服务器与相应客户端 - **Primary Language**: C - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2024-01-20 - **Last Updated**: 2024-01-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 服务器-客户端(聊天) #### 介绍 C语言编写的聊天服务器与相应客户端,可以在不同设备上运行聊天,环境deepin 15.1 服务器,客户端,聊天 #### 软件架构 多线程 socket通信 #### 编译教程 1. 编译server.c 用命令 ``` gcc server.c -pthread -o server ``` 2. 编译client.c 用命令 ``` gcc client.c -pthread -o client ``` ![编译过程](https://images.gitee.com/uploads/images/2021/0705/145711_5743d47e_2346419.png "屏幕截图.png") #### 使用说明 首先使用命令:ifconfig 获取本地IP(服务器IP) 1. 在终端运行服务器程序 ``` ./server ``` 2. 在其他终端运行客户端程序:我的IP是192.168.73.132 ``` ./client 192.168.73.132 ``` ![运行结果](https://images.gitee.com/uploads/images/2021/0705/150025_0b88f5fa_2346419.png "屏幕截图.png") 在客户机中输入quit可以退出 在服务器中直接Ctrl-Z