You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a IPConn object contains a socket object, the socket objects comes from src/net/sock_posix.go,function func socket(ctx context.Context and set socketopts through setDefaultSockopts function
but I can not find any fucntion in go-document to modify the socket's atrribute of the IPConn's socket, So i have to add code
syscall.SetsockoptInt(s, syscall.SOL_SOCKET,syscall.SO_RCVBUF,1010241024) at here: https://github.com/golang/go/blob/master/src/net/sockopt_linux.go#L18
It is not good to modify the go source code,
Do you have a function which I can used to modify the IPConn's socket ? Thanks.
I think it is very useful to modify the socket's attribute such as recv buffer size,as the deafult
value can not satisfy every thing
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered:
gbbr
changed the title
package net.dial,function ListenPacket's connection does not support modify socket's attribute
net/dial: ListenPacket does not support modifying socket options
Nov 15, 2017
mikioh
changed the title
net/dial: ListenPacket does not support modifying socket options
net: ListenPacket does not support modifying socket options
Nov 16, 2017
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?newest
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?linux
What did you do?
https://golang.org/pkg/net/#ListenPacket
this function may return a IPConn object through function ListenIP.
a IPConn object contains a socket object, the socket objects comes from src/net/sock_posix.go,function func socket(ctx context.Context and set socketopts through setDefaultSockopts function
https://github.com/golang/go/blob/master/src/net/sock_posix.go#L46
Here is the question: in my case I want to modify the socket's recv buffer size by
syscall.SetsockoptInt(s, syscall.SOL_SOCKET,syscall.SO_RCVBUF,1010241024)
but I can not find any fucntion in go-document to modify the socket's atrribute of the IPConn's socket, So i have to add code
syscall.SetsockoptInt(s, syscall.SOL_SOCKET,syscall.SO_RCVBUF,1010241024) at here:
https://github.com/golang/go/blob/master/src/net/sockopt_linux.go#L18
It is not good to modify the go source code,
Do you have a function which I can used to modify the IPConn's socket ? Thanks.
I think it is very useful to modify the socket's attribute such as recv buffer size,as the deafult
value can not satisfy every thing
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: