setbuffer_others.go 414 B

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