happyfish100 / libfastcommon

c common functions library extracted from my open source project FastDFS. this library is very simple and stable. functions including: string, logger, chain, hash, socket, ini file reader, base64 encode / decode, url encode / decode, fast timer, skiplist, object pool etc. detail info please see the c header files.
http://bbs.chinaunix.net/forum-240-1.html
GNU Lesser General Public License v3.0
900 stars 529 forks source link

tcprecvdata_ex 函数逻辑有问题。 #9

Open viperlong opened 8 years ago

viperlong commented 8 years ago

第三个参数size,应该是接收buf长度,你默认为接收数据长度了。原来recv可以正常接收的。你可以测试下,你的接收过程中是有问题的。

happyfish100 commented 8 years ago

没有错啊,这个参数的本意就是期望接收的字节数,通过count指针返回实际接收到的字节数。

viperlong commented 7 years ago

如果缓冲中实际数据长度没有达到期望,你的函数不会返回。原来的recv是可以的,读完就返回。