本程序的通信是基于UDP协议的传输实现 服务器端: server.h /*********************************** * server.h * * the header files and functions * ***********************************/#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <stdio.h> #include <errno.h> #include <stdlib.h>#include <string.h>#include <semaphore.h>#include <unistd.h>#include <pthread.h>#include <arpa/inet.h>#define bool _Bool#define true 1#define false 0#define PORT 8888#define MAXSIZE 1024void *recv_func(void *arg);int build_socket();void send_text(void);void send_func(const char *);void show_remote_text(char rcvd_mess[]);void show_err(char *err);void clean_send_text(void);void startup(void);/* 你的当前访问异常,请进行认证后继续阅读剩余内容。 提交