Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luasock(tcp) recvall非阻塞问题 #439

Closed
findstr opened this issue Jan 15, 2016 · 0 comments
Closed

luasock(tcp) recvall非阻塞问题 #439

findstr opened this issue Jan 15, 2016 · 0 comments

Comments

@findstr
Copy link

findstr commented Jan 15, 2016

使用socket.core.tcp以非阻塞方式去读当前socket中的数据时,会返回nil
在源码
https://github.com/dualface/v3quick/blob/v3/external/lua/luasocket/buffer.c#L210#L221处,是不是要对IO_TIMEOUT进行判断, 比如:

    if (err == IO_CLOSED) {
            if (total > 0) return IO_DONE;
            else return IO_CLOSED;
    } else {
            if (err == IO_TIMEOUT && total > 0) err = IO_DONE; 
            return err;
    }

如果理解有误请见谅。

@findstr findstr closed this as completed Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant