随笔

https://server.xixun.com/svn/Xixun.Development/lnuonline_docs/


https://mariadb.com/kb/en/mariadb/non-blocking-client-library/


thrift -r --gen cpp all.thrift


/home/zhangshubo/MyProgram/xxserver/xxsgame/thrift-gen


/home/zhangshubo/.petaclone/attachment/thrift-0.9.2




http://www.cnblogs.com/skynet/archive/2010/10/30/1865267.html
select 多路复用
http://blog.sina.com.cn/s/blog_631ba0bf01013obw.html
select 实现多个客户端
http://www.cnblogs.com/skynet/archive/2010/10/30/1865267.html
多个客户端连接服务器
http://www.cnblogs.com/venow/archive/2012/11/30/2790031.html


github使用
http://blog.csdn.net/chaihuasong/article/details/37911723


use lnuonline_account
select * from account;
delete from account where password like '1%';


(核心版=334NH-RXG76-64THK-C7CKG-D3VPT;专业版=XHQ8N-C3MCJ-RQXB6-WCHYG-C9WKB”)来完成安装,然后在激活的过程中更换成Windows 8密钥,重启即可解决问题。
http://jingyan.baidu.com/article/6181c3e070dd09152ef153a3.html


cygwin移植windows
http://my.oschina.net/michaelyuanyuan/blog/68615


cygwin 找不到socket.h
http://blog.sina.com.cn/s/blog_89f574e501016pb3.html


配置boost
http://www.tuicool.com/articles/Uvu2a2


windows thrift 安装
http://www.cnblogs.com/mumuxinfei/p/3715721.html


 8192






void createsubprocess(int num,int max)
{
    if(num>=max)return;
    pid_t pid;
    pid=fork();
    if(pid<0)
    {
        perror("fork error!\n");
        exit(1);
    }
    //子进程
    else if(pid==0)
    {
        sleep(3);
        printf("子进程id=%d,父进程id=%d\n",getpid(),getppid());
    }
    //父进程
    else
    {
        num++;
        if(num==1)printf("父进程id=%d\n",getpid());
        if(num<max)createsubprocess(num,max);
        //此处加sleep是为了防止父进程先退出,从而产生异常
        sleep(5);
    }
}




http://www.linuxidc.com/Linux/2011-06/37008.htm




void robot_factory::create_thread(pthread_t thread_id)
{
   int rc = 0;
   printf("Creating thread\n");


//   int ret, stacksize = 4096;
//   pthread_attr_t attr;
//   ret = pthread_attr_init(&attr);
//   if(ret != 0)
//   {
//       __xx_throw(strerror(errno));
//   }
//   ret = pthread_attr_setstacksize(&attr, stacksize);
//   if(ret != 0)
//   {
//       __xx_throw(strerror(errno));
//   }


   if(thread_type == thread_account)
   {
       rc = pthread_create(&thread_id, NULL, thread_handle_login_account, NULL);
   }
   else
   {
       rc = pthread_create(&thread_id, NULL, thread_handle_login_client, NULL);
   }


//   ret = pthread_attr_destroy(&attr);
//   if(ret != 0)
//   {
//       __xx_throw(strerror(errno));
//   }
   if(rc != 0)
   {


       fprintf(stderr, "create thread error thread_id %d \n",(int32_t)thread_id);
        __xx_throw(strerror(errno));
   }


}
















    pthread_t threadid[65536];


    for (int32_t i = 0; i < 65536; i++)
    {
        int32_t rc = pthread_create(&threadid[i], NULL, thread_handle_login_account11, NULL);


        if (rc < 0)
        {
            return;
        }


        ++thread_account_count11;
        printf("count %d\n", thread_account_count11);
    }










http://blog.csdn.net/mmbl007/article/details/7446970






 scp ./pressure liulei@192.168.40.170:~/run
 scp 文件夹 -r liulei@192.168.40.170:~/run


yishizhizun369369




http://p.getqujing.com/paths/onf4y7mu.pac


















 while(true)
    {
        sleep(1);
        if (thread_account_count == thread_count)
        {
            printf("nologic total account %d total time is %lu\n", thread_count, account_total_time);
            printf("nologic total account %d average time is %lu\n", thread_count, account_total_time/thread_count);
            printf("client_player_count %d client_reponse_count %d\n",client_player_count, thread_client_count);
            if(client_total_time <= 0)
            {
                break;
            }


        }


        if (thread_client_count == thread_count)
        {
            printf("logic total account %d total time is %lu\n", thread_count, client_total_time);
            printf("logic total account %d total time is %lu\n", thread_count, client_total_time/thread_count);
            break;
        }
    }




gdb 调式core文件 显示乱码的问题
http://www.vimer.cn/2009/11/%E4%BD%BF%E7%94%A8gdb%E8%B0%83%E8%AF%95%E7%A8%8B%E5%BA%8F%E8%AF%A6%E8%A7%A3.html














































using namespace std;


char          message[BUF_SIZE];
list<int32_t> list_of_clients;
int32_t       res;
clock_t       tStart;


int main(int argc, char* argv[])
{
    int32_t  sock;
    struct   sockaddr_in addr;
    addr.sin_family = PF_INET;
    addr.sin_port   = htons(SERVER_PORT);
    addr.sin_addr.s_addr = inet_addr(SERVER_HOST);


    tStart = clock();
    for(int32_t i = 0; i < EPOLL_SIZE; i++)
    {
        CHK2(sock, socket(PF_INET, SOCK_STREAM, 0));
        CHK(connect(sock, (struct sockaddr *)&addr, sizeof(addr)));
        list_of_clients.push_back(sock);


        memset(message, 0 , BUF_SIZE);
        CHK2(res, recv(sock, message, BUF_SIZE, 0));
        printf("%s\n", message);
    }


    list<int>::iterator it;
    for(it = list_of_clients.begin(); it != list_of_clients.end(); it++)
    {
        close(*it);
    }


    printf("Test passed at: %.2f second(s)\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
    printf("Total server connections was: %d\n", EPOLL_SIZE);


    return 0;


}






青云
https://www.qingcloud.com
developer@xixun.com
ped4vop4m


telnet 117.121.25.196 18702




icloud:920822
me icloud 1880130


SELECT * FROM player where user_id in ('440','439') and ready_for_combat = '1';
SELECT * FROM yishizhizun_main.team where player_job_two > 0 limit 3;


  Select * From cyclopedia Where ID>=( 
  Select Max(ID) From ( 
  Select ID From cyclopedia Order By ID limit 90000,1 
  ) As tmp 
  ) limit 100;


 Select * From cyclopedia Where ID>=( 
  Select Max(ID) From ( 
  Select ID From cyclopedia Order By ID limit 90001 
  ) As tmp 
  ) limit 100;


//group by 去重  limit 限制返回的条数
SELECT * FROM yishizhizun_main.player where player_level> 1 group by user_id limit 2;
ALTER TABLE `test_test` ADD INDEX `num_index` (`num`) ;













评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值