Documentation ¶
Index ¶
- Variables
- func WriteStatus(w io.Writer)
- type Conn
- 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
- type Option
- type Socket
- 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)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrConnClosed = errors.New("closed")
)
View Source
var Logger = log.New(os.Stderr, "go-libutp: ", log.LstdFlags|log.Lshortfile)
Functions ¶
func WriteStatus ¶
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) RemoteAddr ¶
func (*Conn) SetWriteBufferLen ¶
func (*Conn) WriteBufferLen ¶
type FirewallCallback ¶
type Option ¶
const ( LogNormal Option = C.UTP_LOG_NORMAL LogMtu Option = C.UTP_LOG_MTU LogDebug Option = C.UTP_LOG_DEBUG SendBuffer Option = C.UTP_SNDBUF RecvBuffer Option = C.UTP_RCVBUF TargetDelay Option = C.UTP_TARGET_DELAY TimedOut = C.UTP_ETIMEDOUT )
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
func (*Socket) DialContext ¶
Passing an empty network will use the network of the Socket's listener.
func (*Socket) DialTimeout ¶
func (*Socket) ReadBufferLen ¶
func (*Socket) SetFirewallCallback ¶
func (s *Socket) SetFirewallCallback(f FirewallCallback)
func (*Socket) SetWriteBufferLen ¶
func (*Socket) WriteBufferLen ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.