mnet

package module
v0.0.0-...-f248eff Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2016 License: BSD-2-Clause Imports: 15 Imported by: 0

README

mnet

Reliable-ordered transport over udp

Contact

@\boblan_
https://github.com/mendsley/mnet

License

Copyright 2014-2015 Matthew Endsley

This project is governed by the BSD 2-clause license. For details see the file titled LICENSE in the project root folder.

Using

Simply add the following import import "github.com/snuk182/gomnet"

Documentation

See http://godoc.org/github.com/snuk182/gomnet

Documentation

Index

Constants

View Source
const (
	PacketData = PacketType(iota)
	PacketInit
	PacketCookie
	PacketCookieEcho
	PacketCookieAck
	PacketShutdown
	PacketShutdownAck
	PacketShutdownComplete
	PacketAbort
)

Variables

View Source
var (
	ErrConnectionReset  = errors.New("Connection has been reset")
	ErrConnectionClosed = errors.New("Connection has been closed")
	ErrReadTimeout      = errors.New("Read operation timeout")
)
View Source
var (
	ErrBadProcolPacket     = errors.New("Unexpected packet from peer")
	ErrBadDataPacketLength = errors.New("Bad peer DATA packet length")
	ErrPeerAckedUnsentData = errors.New("Peer acked unsent data")
	ErrPeerNotResponding   = errors.New("Peer not responding to traffic")
)
View Source
var (
	ErrBadAddress    = errors.New("Bad peer address")
	ErrNotPacketConn = errors.New("Not a packet connection network")
	ErrConnectFailed = errors.New("Connection to remote peer failed")
)
View Source
var ErrListenerClosed = errors.New("Listener has been closed")

Functions

func Dial

func Dial(network, address string) (net.Conn, error)

Connects to a remote host The network net must be a packet-oriented netowrk: "udp", "udp4", "udp6", "unixgram".

func Listen

func Listen(network, addr string) (net.Listener, error)

Listen announces on the local network address laddr. The network net must be a packet-oriented netowrk: "udp", "udp4", "udp6", "unixgram".

func ListenConn

func ListenConn(conn net.PacketConn) (net.Listener, error)

Listen announces on existing packet-based connection

func NewConn

func NewConn(pc net.PacketConn, addr net.Addr) (net.Conn, error)

Types

type Packet

type Packet struct {
	D []byte
	// contains filtered or unexported fields
}

func NewPacket

func NewPacket(sz int) Packet

func (Packet) Addref

func (p Packet) Addref()

func (Packet) Free

func (p Packet) Free()

func (Packet) Reset

func (p Packet) Reset()

type PacketType

type PacketType byte

type ProtocolPacketError

type ProtocolPacketError struct {
	Type PacketType
}

func (ProtocolPacketError) Error

func (err ProtocolPacketError) Error() string

Jump to

Keyboard shortcuts

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