udp

package
v1.3.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2020 License: ISC Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dialer = net.Dialer{
	Timeout: 10 * time.Second,
}

Dialer is the default dialer that this package uses for all its dialing.

View Source
var ErrClosed = errors.New("UDP connection closed")

ErrClosed is returned if a Write was called on a closed connection.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	GatewayIP   string
	GatewayPort uint16
	// contains filtered or unexported fields
}

func DialConnectionCtx added in v0.10.0

func DialConnectionCtx(ctx context.Context, addr string, ssrc uint32) (*Connection, error)

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) UseContext added in v1.3.7

func (c *Connection) UseContext(ctx context.Context) error

UseContext lets the connection use the given context for its Write method. WriteCtx will override this context.

func (*Connection) UseSecret added in v1.3.7

func (c *Connection) UseSecret(secret [32]byte)

UseSecret uses the given secret. This method is not thread-safe, so it should only be used right after initialization.

func (*Connection) Write

func (c *Connection) Write(b []byte) (int, error)

Write sends bytes into the voice UDP connection.

func (*Connection) WriteCtx added in v0.10.0

func (c *Connection) WriteCtx(ctx context.Context, b []byte) (int, error)

WriteCtx sends bytes into the voice UDP connection with a timeout.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL