Documentation
¶
Index ¶
- Constants
- func GetOutboundIP() string
- func MbToBytes(mb uint64) uint64
- func ParsePacket(packet []byte) ([]byte, []byte, error)
- func Ping(remoteHost SocketAddr) error
- func Read(conn *net.Conn) ([]byte, error)
- func Request(remoteHost SocketAddr, route []byte, payload []byte) ([]byte, error)
- func Write(conn *net.Conn, packet []byte) error
- type SocketAddr
- type SocketAddrSlice
Constants ¶
View Source
const EOF byte = 26
View Source
const SocketAddressSize int = 6 // Bytes
Variables ¶
This section is empty.
Functions ¶
func GetOutboundIP ¶
func GetOutboundIP() string
GetOutboundIP gets the preferred outbound ip of this machine
func ParsePacket ¶
ParsePacket into its component route URI and payload
func Ping ¶
func Ping(remoteHost SocketAddr) error
Ping a remote host in an attempts to create a connection, returns an error if the host is unreachable
Types ¶
type SocketAddr ¶
SocketAddr has a size 4 bytes (IPv4) + 2 bytes (port) = 6 bytes
func AddrFromJson ¶
func AddrFromJson(addressInJson []byte) (SocketAddr, error)
func AddrFromString ¶
func AddrFromString(address string) (SocketAddr, error)
func (*SocketAddr) IsEmpty ¶
func (s *SocketAddr) IsEmpty() bool
func (*SocketAddr) ToJson ¶
func (s *SocketAddr) ToJson() ([]byte, error)
func (*SocketAddr) ToString ¶
func (s *SocketAddr) ToString() string
type SocketAddrSlice ¶
type SocketAddrSlice []SocketAddr
func AddrSliceFromJson ¶
func AddrSliceFromJson(addrJson []byte) (SocketAddrSlice, error)
func (*SocketAddrSlice) ToJson ¶
func (s *SocketAddrSlice) ToJson() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.