aboutsummaryrefslogtreecommitdiff
path: root/conn/controlfns_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'conn/controlfns_unix.go')
-rw-r--r--conn/controlfns_unix.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/conn/controlfns_unix.go b/conn/controlfns_unix.go
index 9738c73..c4536d4 100644
--- a/conn/controlfns_unix.go
+++ b/conn/controlfns_unix.go
@@ -16,6 +16,13 @@ import (
func init() {
controlFns = append(controlFns,
func(network, address string, c syscall.RawConn) error {
+ return c.Control(func(fd uintptr) {
+ _ = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_RCVBUF, socketBufferSize)
+ _ = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_SNDBUF, socketBufferSize)
+ })
+ },
+
+ func(network, address string, c syscall.RawConn) error {
var err error
if network == "udp6" {
c.Control(func(fd uintptr) {