BatchSize returns the BatchSize for the device as a whole which is the max of the bind batch size and the tun batch size. The batch size reported by device is the size used to construct memory pools, and is the allowed batch size for the lifetime of the device.
()
| 338 | // is the size used to construct memory pools, and is the allowed batch size for |
| 339 | // the lifetime of the device. |
| 340 | func (device *Device) BatchSize() int { |
| 341 | size := device.net.bind.BatchSize() |
| 342 | dSize := device.tun.device.BatchSize() |
| 343 | if size < dSize { |
| 344 | size = dSize |
| 345 | } |
| 346 | return size |
| 347 | } |
| 348 | |
| 349 | func (device *Device) LookupPeer(pk NoisePublicKey) *Peer { |
| 350 | device.peers.RLock() |