oiocp:overlapped io completion port
net_t use both overlapped and io completion port
the put function
[
void put(const void* buf,unsigned long lenInByte,int id);
void put(netMsg_t *msg);
void put(buf_t *first,buf_t *last);
]
will make a copy of data that you passed in,
net_t internal use mempool to keep the data that will send and have recved
net_t will merge data(when send call not return and before next send call) and send in one call
the data size that send in one call is limited(in sendTask_t)
those async parameter of newServerMsg_t and newClientMsg_t
[
unsigned long asyncRecv;
unsigned long asyncSend;
unsigned long asyncAccept;
unsigned long asyncConnect;
]
means overlapped operation count
use one instance of net_t,you can create many peer listen to accept new connect
and create many peer connect to any server include those listen peer in the same
instance of net_t
send those control msg(newServerMsg_t,newClientMsg_t,...) to SYS_ID to control the net_t
net_t will send notify msg(newServerRetMsg_t,newClientRetMsg_tId,newConnectMsg_tId,...) to user with id = SYS_ID
one instance of net_t can only work in one mode,stream mode or msg mode.
stream mode:
send use:
void put(const void* buf,unsigned long lenInByte,int id);
void put(netMsg_t *msg);
recv use:
buf_t *getBuf(bool wait);
getBuf return a linked list,each buf_t may come from diffrent peer,
the data and data size of buf_t have no relation from put call
msg mode:
send use:
void put(const void* buf,unsigned long lenInByte,int id);
void put(netMsg_t *msg);
recv use:
netMsg_t *get(bool wait);
this function return a linked list,
each netMsg_t may come from diffrent peer,
the data and data size of netMsg_t is the same to each call of put
//warning:see src for use with this two function
netMsg_t &netMsg_t::operator>>(char *&v);
netMsg_t &netMsg_t::operator>>(unsigned char *&v);
warning:the byte order is in raw host order when use netMsg_t to serialize and deserialize data
see netTutorial for use example.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
稳定易用的大容量 windows socket api 封装库,采用重叠完成端口模型实现,引擎采用异步消息控制,实现了一个简明易用的网络框架,发送和接收数据全都采用异步模式,发送和接收数据都不会给调用线程带来等待或者延迟,同时引擎实现了两种通信模式,流模式和消息模式,可以节省用户大量的构建时间。 引擎内部实现参考了 ACE 的种种概念,比如 proactor(预先操作,前摄器),task(任务),主动对象(Active Object),message queue(消息队列),lock(锁),guard(锁守护). 在内部需要缓存的发送和接收的数据会被放入内存池,引擎会循环使用内存池中的内存,不会产生内存碎片,影响系统的稳定性 引擎实现了统一的监听和连接机制,同一个实例可以同时开多个端口监听同时开多个连接,能够大大的方便用户的使用
资源推荐
资源详情
资源评论
收起资源包目录
xgnet oiocp(重叠完成端口) 封装库,网络引擎 (640个子文件)
configure.ac 13KB
Makefile.am 12KB
Makefile.am 11KB
Makefile.am 7KB
Makefile.am 7KB
Makefile.am 2KB
Makefile.am 2KB
Makefile.am 1KB
zzipself.bat 672B
zzipself.bat 672B
zzipself.bat 672B
test.bz 63B
deflate.c 63KB
bzip2.c 57KB
unzip.c 48KB
inflate.c 48KB
bzlib.c 45KB
trees.c 43KB
zip.c 36KB
file.c 35KB
gzio.c 30KB
blocksort.c 30KB
zip.c 28KB
fseeko.c 23KB
infback.c 22KB
mmapped.c 20KB
compress.c 20KB
decompress.c 20KB
write.c 17KB
example.c 16KB
miniunz.c 15KB
bzip2recover.c 15KB
memdisk.c 14KB
inftrees.c 13KB
crc32.c 13KB
inffast.c 12KB
unzip-mem.c 12KB
minizip.c 11KB
dir.c 8KB
minigzip.c 8KB
mztools.c 8KB
zutil.c 7KB
huffman.c 7KB
iowin32.c 6KB
wrap.c 5KB
crctable.c 5KB
adler32.c 4KB
dlltest.c 4KB
err.c 4KB
zziptest.c 4KB
info.c 4KB
randtable.c 4KB
zzobfuscated.c 4KB
ioapi.c 4KB
unzcrash.c 4KB
stat.c 3KB
fetch.c 3KB
zzxordir.c 3KB
unzzipcat-mem.c 3KB
unzzipcat.c 3KB
zzxorcat.c 3KB
unzzipcat-seeko.c 2KB
zzipwrap.c 2KB
zzxorcopy.c 2KB
compress.c 2KB
unzzip.c 2KB
unzzipdir.c 2KB
uncompr.c 2KB
unzzipdir-mem.c 2KB
zzipself.c 2KB
zzdir.c 2KB
zzip.c 2KB
plugin.c 2KB
spewG.c 2KB
SDL_rwops_zzip.c 2KB
zzcat.c 2KB
SDL_rwops_zzcat.c 1KB
zzipsetstub.c 1KB
mk251.c 919B
ChangeLog 67KB
ChangeLogUnzip 2KB
configure 611KB
xml.cpp 22KB
err.cpp 20KB
wsaerr.cpp 19KB
peer_t.cpp 15KB
app_t.cpp 9KB
zip_stream_test.cpp 9KB
str_t.cpp 9KB
bzip2_stream_test.cpp 8KB
netMsg_t.cpp 7KB
unpackTask_t.cpp 7KB
pathUtil.cpp 7KB
peerTask_t.cpp 6KB
netMsgTimeServerTask_t.cpp 6KB
net_t.cpp 6KB
alarm_t.cpp 5KB
connectTask_t.cpp 5KB
acceptTask_t.cpp 5KB
sendTask_t.cpp 4KB
共 640 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
pilgarlicx
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功