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

configurable whether blocking mode for the interface device on linux #57

Closed
wants to merge 1 commit into from

Conversation

warriorpaw
Copy link

need blocking mode in some case

@songgao
Copy link
Owner

songgao commented Mar 5, 2019

Could you explain your use case please? I'm having a hard time seeing how this can be useful.

@warriorpaw
Copy link
Author

Could you explain your use case please? I'm having a hard time seeing how this can be useful.

https://github.com/songgao/water#tap-on-linux
In nonblock mode.
n, err := ifce.Read([]byte(frame))
will return err 'read tun: resource temporarily unavailable'.
I want to blocked read data in a goroutine, put data in channels then work with it in other goroutines.
Using go1.10.4 & ubuntu 18.04.

@songgao
Copy link
Owner

songgao commented Mar 24, 2019

@warriorpaw sorry for the slow response. I can't reproduce this with go1.12.1. Presumably in a reasonably recent Go version this should already be taken care of by internal handling of nonblock stuff in Go. Could you share what Go version you're running?

@warriorpaw
Copy link
Author

go1.10.4 linux/amd64 on Ubuntu 18.04

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

Successfully merging this pull request may close these issues.

2 participants