⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global.c

📁 在linux系统下实现了一个多人聊天工具的服务器端和客户端。该工具支持显示在线用户
💻 C
字号:
#include "global.h"

bucket_list hash_table[SIZE];/*a hash table to record the information
			      *for the user and it used the user 
			      name to index the information*/
addr_list addr_table[SIZE];  /*a hash table to record the information
			       for the user and it used the user
			       file descriptor to index the information*/
int on_line_num = 0;	/*the number of user on line*/

int max_user = 500;	/*the max number of user allow to
			  connect to the server at the same time*/

pthread_mutex_t num_mutex; /*make sure the correctness of the number
			     of user*/
pthread_mutex_t name_mutex; /*make sure the correctness of the hash
			      table hash_table[]*/
pthread_mutex_t addr_mutex; /*make sure the correctness of the hash
			      table addr_table[]*/
pthread_mutex_t host_mutex; /*make sure the correctness of the link
			      list of host*/
host_list * host_head = NULL;	/*point to the head of the host link list*/

host_list * host_tail = NULL;	/*point to the tail of the host link list*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -