原创 XMPP 關鍵概念
http://www.cnblogs.com/uvsjoh/archive/2012/08/28/2660155.html以文檔的觀點來看,客戶端或服務器發送的所有XML文本連綴在一起,從<stream>到</stream>構成了一個完整的
原创 erlang中查找佔用內存最多的進程
在erlang查看佔用內存最多的進程,可以用etop,在終端輸入下面語句:spawn(fun() -> etop:start([{output, text}, {interval, 1}, {lines, 20}, {sort,
原创 安裝erlang的vim插件vimerl插件
1.創建目錄mkdir -p ~/.vim/autoload ~/.vim/bundle 2.下載pathogen插件wget -O ~/.vim/autoload/pathogen.vim https://raw.github.com/t
原创 XMPP 關鍵概念
http://www.cnblogs.com/uvsjoh/archive/2012/08/28/2660155.html以文檔的觀點來看,客戶端或服務器發送的所有XML文本連綴在一起,從<stream>到</stream>構成了一個完整的
原创 我的友情鏈接
51CTO博客開發
原创 Unix網絡編程代碼 第11章 名字與地址轉換
第11章 名字與地址轉換 11.3 gethostbyname函數 #define _BSD_SOURCE #include <stdarg.h> #include <stdlib.h> #include <stdio.h> #incl
原创 Unix網絡編程代碼 第16章 非阻塞式I/O
第16章 非阻塞式I/O 16.2 非阻塞讀和寫:str_cli函數(修訂版) //使用select #include <netinet/in.h> /* sockaddr_in{} and other Internet defns */
原创 Unix網絡編程代碼 第20章 廣播
第20章 廣播 20.4 使用廣播的dg_cli函數 //運行前啓動daytime服務,運行:./client 192.168.1.255,啓動後,隨便輸入字符 #include <netinet/in.h> /* sockaddr_in
原创 Unix網絡編程代碼 第13章 守護進程和inetd超級服務器
第13章 守護進程和inetd超級服務器 13.4 daemon_init函數 13.4.1 作爲守護進程運行的協議無關時間獲取服務器程序 運行: ./server localhost daytime 查看日誌: tail /var/lo
原创 Unix網絡編程代碼 第28章 原始套接字
第28章 原始套接字 28.5 ping程序 #define _GNU_SOURCE #include <sys/time.h> #include <sys/un.h> #include <string.h> #include <arpa
原创 位圖算法 C語言
#include <stdio.h> void set_bit(void *base, unsigned long n) { unsigned long *m = (unsigned long*) base;
原创 Unix網絡編程代碼 第7章 套接字選項
第7章 套接字選項 7.3 檢查選項是否受支持並獲取默認值 #define __need_timeval #include <stdio.h> #include <time.h> #include <netinet/tcp.h> /*
原创 用條件變量實現阻塞隊列
#include <pthread.h> #include <stdio.h> #include <stdlib.h> const int NUM = 20; struct node { int val; struct
原创 逆轉字符串 C語言
#include <stdio.h> #include <string.h> char* Reverse(char *str) { if(str == NULL) return str; size
原创 Unix網絡編程代碼 第17章 ioctl操作
第17章 ioctl操作 17.6 get_ifi_info函數 #define _GNU_SOURCE #include <netinet/in.h> /* sockaddr_in{} and other Internet defns