// Code generated by go generate. DO NOT EDIT.// Source: sys_conn_buffers.gopackage quicimport ()func setSendBuffer( net.PacketConn) error { , := .(interface{ (int) error })if ! {returnerrors.New("connection doesn't allow setting of send buffer size. Not a *net.UDPConn?") }varsyscall.RawConnif , := .(interface { () (syscall.RawConn, error) }); {varerror , = .()if != nil { = nil } }// The connection has a SetWriteBuffer method, but we couldn't obtain a syscall.RawConn. // This shouldn't happen for a net.UDPConn, but is possible if the connection just implements the // net.PacketConn interface and the SetWriteBuffer method. // We have no way of checking if increasing the buffer size actually worked.if == nil {return .(desiredBufferSize) } , := inspectWriteBuffer()if != nil {returnfmt.Errorf("failed to determine send buffer size: %w", ) }if >= desiredBufferSize {utils.DefaultLogger.Debugf("Conn has send buffer of %d kiB (wanted: at least %d kiB)", /1024, desiredBufferSize/1024)returnnil }// Ignore the error. We check if we succeeded by querying the buffer size afterward. _ = .(desiredBufferSize) , := inspectWriteBuffer()if < desiredBufferSize {// Try again with RCVBUFFORCE on Linux _ = forceSetSendBuffer(, desiredBufferSize) , = inspectWriteBuffer()if != nil {returnfmt.Errorf("failed to determine send buffer size: %w", ) } }if != nil {returnfmt.Errorf("failed to determine send buffer size: %w", ) }if < desiredBufferSize {if == {returnfmt.Errorf("failed to increase send buffer size (wanted: %d kiB, got %d kiB)", desiredBufferSize/1024, /1024) }returnfmt.Errorf("failed to sufficiently increase send buffer size (was: %d kiB, wanted: %d kiB, got: %d kiB)", /1024, desiredBufferSize/1024, /1024) }utils.DefaultLogger.Debugf("Increased send buffer size to %d kiB", /1024)returnnil}
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.