SetBindToDevice sets value for SO_BINDTODEVICE option. If bindToDevice is zero, the socket device binding is removed.
(bindToDevice int32)
| 695 | // SetBindToDevice sets value for SO_BINDTODEVICE option. If bindToDevice is |
| 696 | // zero, the socket device binding is removed. |
| 697 | func (so *SocketOptions) SetBindToDevice(bindToDevice int32) Error { |
| 698 | if bindToDevice != 0 && !so.handler.HasNIC(bindToDevice) { |
| 699 | return &ErrUnknownDevice{} |
| 700 | } |
| 701 | |
| 702 | so.bindToDevice.Store(bindToDevice) |
| 703 | return nil |
| 704 | } |
| 705 | |
| 706 | // GetSendBufferSize gets value for SO_SNDBUF option. |
| 707 | func (so *SocketOptions) GetSendBufferSize() int64 { |