linux下用c语言编写的聊天室程序,服务器和客户端.docxVIP

  • 154
  • 0
  • 约1.23万字
  • 约 14页
  • 2019-06-20 发布于广东
  • 举报

linux下用c语言编写的聊天室程序,服务器和客户端.docx

/* server.c ★ Created on: 2012-6-15 Author: root */ #include stdio.h #include stdlib.h #include pthread.h #include string.h #include unistd.h #inelude sys/socket.h #include sys/types.h #include error.h #includenetinet/in.h #define PORT 7999 #define MAX_NUM 3 //client 连接最大个数 #define MAX_CLIENT 15 #define MAX_SIZE 1024 pthread_rwlock_t idxjock, waitjock; //client 信息 typedef struct _client { int sockfd; char name[20]; pthread_t pid; int fig; } c_client; c_client client[MAX_CLIENT];//定义 client; //等待的client struct _client_ { int sockfd; char name[20]; pthread_t pid; struct _client_ *next; }; typed

文档评论(0)

1亿VIP精品文档

相关文档