摘要:Linux环境设置Socket接收和发送超时:须如下定义:struct timeval timeout = {3,0};//设置发送超时setsockopt(socket,SOL_SOCKET,SO_SNDTIMEO,(char *)&timeout,sizeof(struct timeval));...
阅读全文
摘要:最近学习MQTT协议,选择了当前比较流行的MQTT Broker “mosquitto”,但是在阅读代码过程中发现其网络底层库封装的相当差劲。对于MQTT协议的变长头长度的读取上,基本上采取每次一个byte的方式进行读取判断,对于系统调用read的高代价来讲,真的是相当的浪费,也难怪其不能作为高并发...
阅读全文
摘要:eglibc 2.11 allocator (a variant of ptmalloc), nedmalloc 1.06, hoard 3.8, jemalloc 2.2.1, and tcmalloc 1.7 性能测试http://locklessinc.com/benchmarks_alloc...
阅读全文
摘要:原文地址:http://hbprotoss.github.io/posts/li-yong-ld_preloadjin-xing-hook.html好久没玩hook这种猥琐的东西里,今天在Linux下体验了一把。loader在进行动态链接的时候,会将有相同符号名的符号覆盖成LD_PRELOAD指定的...
阅读全文
摘要:$uname-aLinuxdebian-11-343.16.0-4-amd64#1SMPDebian3.16.7-ckt9-3~deb8u1(2015-04-24)x86_64GNU/Linux经过测试Debina 8.0 已经解决了Aceept thundering herdhttps://gis...
阅读全文
摘要:设置相关脚本:默认:$cat /proc/sys/net/ipv4/ip_local_port_range32768 61000$cat setting.sh#/bin/bash# modify backlog, meanwhile change listen function to 1024, ...
阅读全文