1 Star 0 Fork 6

Ranxy95/udphole

forked from leon/udphole 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
proto.h 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
leon 提交于 2014-08-06 09:38 . 上传
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <pthread.h>
#include <malloc.h>
#define SERVER_PORT 8003
#define CLIENT_PORT 8004
#define MAX_USER 20
#define COMMANDMAX 256
#define MAXRETRY 2
#define LOGIN 1
#define LOGOUT 2
#define P2PTRANS 3
#define GETALLUSER 4
#define P2PMESSAGE 100
#define P2PMESSAGEACK 101
#define P2PSOMEONEWANTTOCALLYOU 102
#define P2PTRASH 103
struct loginmessage
{
char username[20];
char password[20];
};
struct logoutmessage
{
char username[20];
};
struct p2ptranslate
{
char username[20];
};
struct message
{
int messagetype;
union _message
{
struct loginmessage loginmember;
struct logoutmessage logoutmember;
struct p2ptranslate translatemessage;
}_message;
};
struct userlistnode
{
char username[20];
unsigned int ip;
unsigned short port;
};
struct p2pmessage
{
int messagetype;
int stringlen;
unsigned short port;
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/Ranxy95/udphole.git
git@gitee.com:Ranxy95/udphole.git
Ranxy95
udphole
udphole
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385