Documentation ¶
Index ¶
- func GetUDPAddr(address string) (sendAddr *net.UDPAddr)
- type Connection
- func (c *Connection) CreateShards(b, magic []byte) (shards [][]byte, err error)
- func (c *Connection) Listen(handlers HandleFunc, ifc interface{}, lastSent *time.Time, firstSender *string) (err error)
- func (c *Connection) Send(b, magic []byte) (err error)
- func (c *Connection) SendShards(shards [][]byte) (err error)
- func (c *Connection) SendShardsTo(shards [][]byte, addr *net.UDPAddr) (err error)
- func (c *Connection) SendTo(addr *net.UDPAddr, b, magic []byte) (err error)
- func (c *Connection) SetSendConn(ad ...string) (err error)
- type HandleFunc
- type MsgBuffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetUDPAddr ¶
Types ¶
type Connection ¶
Connection is the state and working memory references for a simple reliable UDP lan transport, encrypted by a GCM AES cipher, with the simple protocol of sending out 9 packets containing encrypted FEC shards containing a slice of bytes. This protocol probably won't work well outside of a multicast lan in adverse conditions but it is designed for local network control systems
func NewConnection ¶
func NewConnection(send, listen, preSharedKey string, maxDatagramSize int, ctx context.Context, multicast bool) (c *Connection, err error)
NewConnection creates a new connection with a defined default send connection and listener and pre shared key password for encryption on the local network
func (*Connection) CreateShards ¶
func (c *Connection) CreateShards(b, magic []byte) (shards [][]byte, err error)
func (*Connection) Listen ¶
func (c *Connection) Listen(handlers HandleFunc, ifc interface{}, lastSent *time.Time, firstSender *string) (err error)
func (*Connection) Send ¶
func (c *Connection) Send(b, magic []byte) (err error)
func (*Connection) SendShards ¶
func (c *Connection) SendShards(shards [][]byte) (err error)
func (*Connection) SendShardsTo ¶
func (c *Connection) SendShardsTo(shards [][]byte, addr *net.UDPAddr) (err error)
func (*Connection) SendTo ¶
func (c *Connection) SendTo(addr *net.UDPAddr, b, magic []byte) (err error)
func (*Connection) SetSendConn ¶
func (c *Connection) SetSendConn(ad ...string) (err error)
type HandleFunc ¶
Click to show internal directories.
Click to hide internal directories.