improve error message when the read buffer size can't be set

This commit is contained in:
Marten Seemann 2021-01-26 10:48:29 +08:00
parent 622ca23d4e
commit 75ed1401d8

View file

@ -58,7 +58,7 @@ var _ packetHandlerManager = &packetHandlerMap{}
func setReceiveBuffer(c net.PacketConn, logger utils.Logger) error {
conn, ok := c.(interface{ SetReadBuffer(int) error })
if !ok {
return errors.New("connection doesn't allow setting of receive buffer size")
return errors.New("connection doesn't allow setting of receive buffer size. Not a *net.UDPConn?")
}
size, err := inspectReadBuffer(c)
if err != nil {