pull/12/head
q191201771 2 years ago
commit b98a2ca324

@ -71,6 +71,20 @@ func NewUdpConnection(modOptions ...ModUdpConnectionOption) (*UdpConnection, err
return c, err
}
func (c *UdpConnection) SetReadBuffer(bufSize int) error {
err := c.option.Conn.SetReadBuffer(bufSize)
if err != nil {
c.Dispose()
}
return err
}
func (c *UdpConnection) SetWriteBuffer(bufSize int) error {
err := c.option.Conn.SetWriteBuffer(bufSize)
if err != nil {
c.Dispose()
}
return err
}
// 阻塞直至Read发生错误或上层回调函数返回false
//
// @return error: 如果外部调用Dispose会返回error

Loading…
Cancel
Save