setbuffer_others.go 433 B

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