一个简单的高并发的回应服务器(5万并发)

一个简单的高并发的回应服务器,主要是使用boost的库! 自己测试过可以达到5万个并发!

程序的下载地址:http://download.csdn.net/detail/guanyijun123/8335907


#include <stdio.h>
//#include "AuthenHandle.h"
//#include "configure.h"
//#include "NetSocketCommand.h"

#ifdef WIN32 //for windows nt/2000/xp

 
//#include "gelsserver.h"
#pragma comment(lib,"Ws2_32.lib")
#else         //for unix


#include <sys/socket.h>
//    #include <sys/types.h>

//    #include <sys/signal.h>

//    #include <sys/time.h>

#include <netinet/in.h>     //socket

//    #include <netdb.h>

#include <unistd.h>            //gethostname

// #include <fcntl.h>

#include <arpa/inet.h>

#include <string.h>            //memset

typedef int SOCKET;
typedef struct sockaddr_in SOCKADDR_IN;
typedef struct sockaddr SOCKADDR;
#ifdef M_I386
typedef int socklen_t;
#endif

#define BOOL             int
#define INVALID_SOCKET    -1
#define SOCKET_ERROR     -1
#define TRUE             1
#define FALSE             0
#endif        //end #ifdef WIN32

static int count111 = 0;
static time_t oldtime = 0, nowtime = 0;

#include <list>
#include <cstdlib>
#include <iostream>
#include <stdexcept>
#include <boos
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值