Commit Graph

7 Commits

Author SHA1 Message Date
Ian Bishop 0e3b74dbe2 replace syscall with golang.org/x/sys/unix 2017-10-26 09:45:08 -07:00
Vincent Bernat 808afc82b2 handle: ability for force receive buffer size
This uses `SO_RCVBUFFORCE` instead of `SO_RCVBUF`. This requires to be
root and Linux 2.6.14.
2017-10-20 10:10:50 -07:00
Vincent Bernat ef84ebb87b handle: get/set receive buffer size
When receiving a lot of route changes (10,000 routes are enough), the
default receive buffer size (value of
`/proc/sys/net/core/rmem_default`) is too small and we get a `ENOBUF`
error. A user may want to increase the buffer size up to the value of
`/proc/sys/net/core/rmem_max` (by default, this is the same value). A
`SetSocketReceiveBufferSize()` function is provided to this
destination.

Possible improvements:

 1. automatically increase receive buffer size in higher level
    functions until we hit a maximum (get an error and/or the current
    value is smaller than expected)

 2. accept a "force" argument to use `SO_RCVBUFFORCE` to increase the
    value over `rmem_max` value
2017-10-20 10:10:50 -07:00
Flavio Crisciani 6177f17de7 Add method to set netlink recv timeout
If the socket is closed the recv that are waiting for messages
are not woken up. The result especially for Subscribe socket is
most likely a go routine leak.
This commit introduces a method to set the timeout

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-20 10:09:56 -07:00
Alessandro Boch 17ea11b5a1 Allow setting socket timeout on Handle
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-11-15 11:01:07 -08:00
Alessandro Boch 734d02c3e2 Allow to specify netlink families for Handle (#143)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-20 09:25:15 -07:00
Vish Ishaya 0bc457d244 fix darwin build by moving code (#138)
Fixes issue #135
2016-06-15 08:44:14 -07:00