ASockLib
1.0.0
一個簡單易用的跨平台C++套接字伺服器/客戶端框架,特別方便處理TCP定長頭和變長體。當然,它也支援udp和域套接字。
相依性:CumBuffer。
// See the sample folder for all examples.
// this is an inheritance usage.
// you can find composition usage and udp, domain socket example too.
// msg_defines.h
// user specific data
typedef struct _ST_MY_CHAT_HEADER_
{
char msg_len[ 10 + 1 ];
} ST_MY_HEADER ;
# define CHAT_HEADER_SIZE sizeof (ST_MY_HEADER)