Debian Codegraph @

setbuffer_others.go

raw
1 //go:build !linux
2 // +build !linux
3
4 package socket
5
6 import "golang.org/x/sys/unix"
7
8 // setReadBuffer wraps the SO_RCVBUF setsockopt(2) option.
9 func (c *Conn) setReadBuffer(bytes int) error {
10 return c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_RCVBUF, bytes)
11 }
12
13 // setWriteBuffer wraps the SO_SNDBUF setsockopt(2) option.
14 func (c *Conn) setWriteBuffer(bytes int) error {
15 return c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_SNDBUF, bytes)
16 }