Versions in this module Expand all Collapse all v2 v2.1.7 Jul 10, 2025 Changes in this version + type AllocationConfig struct + Client Client + Integrity stun.MessageIntegrity + Lifetime time.Duration + Log logging.LeveledLogger + Net transport.Net + Nonce stun.Nonce + Realm stun.Realm + RelayedAddr net.Addr + ServerAddr net.Addr + Username stun.Username + type Client interface + OnDeallocated func(relayedAddr net.Addr) + PerformTransaction func(msg *stun.Message, to net.Addr, dontWait bool) (TransactionResult, error) + WriteTo func(data []byte, to net.Addr) (int, error) + type PeriodicTimer struct + func NewPeriodicTimer(id int, timeoutHandler PeriodicTimerTimeoutHandler, interval time.Duration) *PeriodicTimer + func (t *PeriodicTimer) IsRunning() bool + func (t *PeriodicTimer) Start() bool + func (t *PeriodicTimer) Stop() + type PeriodicTimerTimeoutHandler func(timerID int) + type TCPAllocation struct + func NewTCPAllocation(config *AllocationConfig) *TCPAllocation + func (a *TCPAllocation) Accept() (net.Conn, error) + func (a *TCPAllocation) AcceptTCP() (transport.TCPConn, error) + func (a *TCPAllocation) AcceptTCPWithConn(conn net.Conn) (*TCPConn, error) + func (a *TCPAllocation) Addr() net.Addr + func (a *TCPAllocation) BindConnection(dataConn *TCPConn, cid proto.ConnectionID) error + func (a *TCPAllocation) Close() error + func (a *TCPAllocation) Connect(peer net.Addr) (proto.ConnectionID, error) + func (a *TCPAllocation) CreatePermissions(addrs ...net.Addr) error + func (a *TCPAllocation) Dial(network, rAddrStr string) (net.Conn, error) + func (a *TCPAllocation) DialTCP(network string, lAddr, rAddr *net.TCPAddr) (*TCPConn, error) + func (a *TCPAllocation) DialTCPWithConn(conn net.Conn, _ string, rAddr *net.TCPAddr) (*TCPConn, error) + func (a *TCPAllocation) DialWithConn(conn net.Conn, network, rAddrStr string) (*TCPConn, error) + func (a *TCPAllocation) HandleConnectionAttempt(from *net.TCPAddr, cid proto.ConnectionID) + func (a *TCPAllocation) SetDeadline(t time.Time) error + type TCPConn struct + ConnectionID proto.ConnectionID + func (c *TCPConn) LocalAddr() net.Addr + func (c *TCPConn) RemoteAddr() net.Addr + type Transaction struct + Key string + Raw []byte + To net.Addr + func NewTransaction(config *TransactionConfig) *Transaction + func (t *Transaction) Close() + func (t *Transaction) Retries() int + func (t *Transaction) StartRtxTimer(onTimeout func(trKey string, nRtx int)) + func (t *Transaction) StopRtxTimer() + func (t *Transaction) WaitForResult() TransactionResult + func (t *Transaction) WriteResult(res TransactionResult) bool + type TransactionConfig struct + IgnoreResult bool + Interval time.Duration + Key string + Raw []byte + To net.Addr + type TransactionMap struct + func NewTransactionMap() *TransactionMap + func (m *TransactionMap) CloseAndDeleteAll() + func (m *TransactionMap) Delete(key string) + func (m *TransactionMap) Find(key string) (*Transaction, bool) + func (m *TransactionMap) Insert(key string, tr *Transaction) bool + func (m *TransactionMap) Size() int + type TransactionResult struct + Err error + From net.Addr + Msg *stun.Message + Retries int + type TryLock struct + func (c *TryLock) Lock() error + func (c *TryLock) Unlock() + type UDPConn struct + func NewUDPConn(config *AllocationConfig) *UDPConn + func (a *UDPConn) CreatePermissions(addrs ...net.Addr) error + func (c *UDPConn) Close() error + func (c *UDPConn) FindAddrByChannelNumber(chNum uint16) (net.Addr, bool) + func (c *UDPConn) HandleInbound(data []byte, from net.Addr) + func (c *UDPConn) LocalAddr() net.Addr + func (c *UDPConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) + func (c *UDPConn) SetDeadline(t time.Time) error + func (c *UDPConn) SetReadDeadline(t time.Time) error + func (c *UDPConn) SetWriteDeadline(time.Time) error + func (c *UDPConn) WriteTo(p []byte, addr net.Addr) (int, error)