-
Notifications
You must be signed in to change notification settings - Fork 68
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
How is SetDeadline supposed to work? #12
Comments
Are you running a Mac? If so, you should see an unimplemented error in the return value of SetDeadline. Definitely check the error return value. |
@mdlayher oh, yeah, I'm on a mac. I didn't realize there was an error return value. Sorry about that! |
Is there an alternative for us mac users that might also be portable to Linux? |
No worries. The package itself works on Linux, Mac, and BSD, but timeouts are only implemented on Linux, and using a hack at that. If we could gain access to the runtime network poller, that would solve the problem, but it hasn't happened yet. Unfortunately I don't have a better solution at this time, other than maybe using goroutines and select to close the raw socket on a timeout. It's a hack though. |
Is there any way to make an ARP request and return with the mac address or after a timeout? Could I do this with (Sorry for the basic questions. Still trying to get a feel for the language.) |
That's basically how Resolve works, but since timeouts aren't implemented, it'll block indefinitely on the call to Read. |
ah, I understand now. Thanks. I appreciate the help. |
Perhaps beating a dead horse here, but I'm trying to run this in an Ubuntu docker container and it's not working. |
My code:
When I try to resolve a nonexistent IP,
arpClient.Resolve()
hangs indefinitely. I'd like to specify a timeout, and I thought thatSetDeadline
orSetReadDeadline
would work. Obviously I'm doing something wrong. Advice appreciated.The text was updated successfully, but these errors were encountered: