Versions in this module Expand all Collapse all v1 v1.0.3 Jun 6, 2019 Changes in this version + var ErrConnClosed = errors.New("closed") + var Logger = log.New(os.Stderr, "go-libutp: ", log.LstdFlags | log.Lshortfile) + func WriteStatus(w io.Writer) + type Conn struct + func (c *Conn) Close() error + func (c *Conn) Connect(ctx context.Context, network, addr string) error + func (c *Conn) LocalAddr() net.Addr + func (c *Conn) OnError(f func(error)) + func (c *Conn) Read(b []byte) (int, error) + func (c *Conn) RemoteAddr() net.Addr + func (c *Conn) SetDeadline(t time.Time) error + func (c *Conn) SetReadDeadline(t time.Time) error + func (c *Conn) SetWriteBufferLen(len int) + func (c *Conn) SetWriteDeadline(t time.Time) error + func (c *Conn) Write(b []byte) (n int, err error) + func (c *Conn) WriteBufferLen() int + type FirewallCallback func(net.Addr) bool + type Option = C.int + const LogDebug + const LogMtu + const LogNormal + const RecvBuffer + const SendBuffer + const TargetDelay + const TimedOut + type Socket struct + func NewSocket(network, addr string) (*Socket, error) + func (s *Socket) Accept() (net.Conn, error) + func (s *Socket) Addr() net.Addr + func (s *Socket) Close() error + func (s *Socket) Dial(addr string) (net.Conn, error) + func (s *Socket) DialContext(ctx context.Context, network, addr string) (net.Conn, error) + func (s *Socket) DialTimeout(addr string, timeout time.Duration) (net.Conn, error) + func (s *Socket) LocalAddr() net.Addr + func (s *Socket) NewConn() (*Conn, error) + func (s *Socket) ReadBufferLen() int + func (s *Socket) ReadFrom(b []byte) (n int, addr net.Addr, err error) + func (s *Socket) SetDeadline(t time.Time) error + func (s *Socket) SetFirewallCallback(f FirewallCallback) + func (s *Socket) SetOption(opt Option, val int) int + func (s *Socket) SetReadDeadline(t time.Time) error + func (s *Socket) SetWriteBufferLen(len int) + func (s *Socket) SetWriteDeadline(t time.Time) error + func (s *Socket) WriteBufferLen() int + func (s *Socket) WriteTo(b []byte, addr net.Addr) (int, error)