UDP-创建群聊

03-15 1269阅读 0评论

服务器

UDP-创建群聊,UDP-创建群聊,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,服务器,创建,存储,第1张
(图片来源网络,侵删)
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#define send_port "8888"
#define send_ip "192.168.1.6"
//存储用户端信息
typedef struct user{
	struct sockaddr_in user;
	struct user* next;
	struct user* prve;
}USER;
//创建链表
USER* creat_link(void){
	USER* head=(USER*)malloc(sizeof(struct user));
	head->next=NULL;
	head->prve=NULL;
	memset(&(head->user),0,sizeof(head->user));
	return head;
}
//新用户上线
void add_link(USER* head,struct sockaddr_in usr){
	USER* uhead=(USER*)malloc(sizeof(USER));
	uhead->next=head->next;
	uhead->prve=head;
	uhead->user=usr;
	head->next=uhead;
	return ;
}
//用户下线
void delete_link(USER* head){
	USER* temp =NULL;
	temp=head->prve;
	temp->next=head->next;
	head->next->prve=temp;
	free(head);
	return ;
}
int main(int argc, const char *argv[])
{
	//创建链表
	USER* head=creat_link();
	int sockfd = socket(AF_INET,SOCK_DGRAM,0);
	if(sockfd

免责声明
本网站所收集的部分公开资料来源于AI生成和互联网,转载的目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

发表评论

快捷回复: 表情:
评论列表 (暂无评论,1269人围观)

还没有评论,来说两句吧...

目录[+]