We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
by cfanfrank:
I want to use setsockopt do SO_BINDTODEVICE such things that MUST before connect() or listen(). I cannot find any options in DialTCP.
The text was updated successfully, but these errors were encountered:
Comment 1:
You can make your own platform-dependent socket creation routine like the following: import ( "syscall" "net" ) s, err := syscall.Socket(...) if err !- nil { // error handling } if err := syscall.Bind(s, ...); err !- nil { // error handling } if err := syscall.Connect(...); err !- nil { // error handling } c, err := net.FileConn(s) if err !- nil { // error handling }
Status changed to Retracted.
Sorry, something went wrong.
Comment 2:
/amend/ 1) Please don`t forget to call syscall.SetsockoptInt or other before syscall.Bind http://golang.org/pkg/syscall/#SetsockoptInt 2) net.FileConn should take *os.File, so f := os.NewFile(s, "name"); c, err := net.FileConn(f) http://golang.org/pkg/os/#NewFile 3) Please don't forget to close f after net.FileConn http://golang.org/pkg/net/#FileConn
No branches or pull requests
by cfanfrank:
The text was updated successfully, but these errors were encountered: