📄 test.cpp
字号:
#include "inetengine.h"
#include <iostream>
#include "FCNTL.H"
#include "direct.h"
#include "io.h"
int i=0;
enum tag{
MSG_CHAR = 1,
};
struct pack{
tag s_tag;
char s_a[1000];
char s_string[30];
};
bool Msg( KEY* a,NET_MSG b )
{
// char temp_str[255];
// long fp_dest;
if( b == NET_MSG_CLOSE )
{
printf("clientclose");
}
pack* p=(pack*)a->s_sRecvBuf.buf;
if(p->s_tag == MSG_CHAR)
{
printf("recv %s\n",p->s_string);
// Sleep(10);
/*
char file_str[255];
sprintf(file_str,"c:\\log.txt");
fp_dest=open(file_str,O_TEXT|O_WRONLY|O_APPEND);
memset(temp_str,0,255);
sprintf(temp_str,"recv %s\n",p->s_string);
write(fp_dest,temp_str,strlen(p->s_string)+6);
_close(fp_dest);
*/
pack temp;
//sprintf(temp.s_string,"%d",i);
//strcpy(temp.s_string,"test");
i++;
temp.s_tag = MSG_CHAR;
//for(int t=0;t<1000;t++)
//{
sprintf(temp.s_string,"%s",p->s_string);
printf("send %s\n",temp.s_string);
FOXNETSendBuf(a,&temp,sizeof(pack));
//}
}
return true;
}
void main()
{
FOXNETCreateServer(Msg);
FOXNETListen();
//
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -