network

package
v0.0.0-...-b16fe82 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2015 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	Id                  string
	Name                string
	ProtocolVersion     int
	Type                string
	PublicKey           *crypto.PublicKey
	Paired              bool
	PairRequestReceived bool
	PairRequestSent     bool
	Incoming            chan *protocol.Package
	// contains filtered or unexported fields
}

func NewDevice

func NewDevice(conn net.Conn) *Device

func (*Device) Addr

func (d *Device) Addr() net.Addr

func (*Device) Close

func (d *Device) Close() error

func (*Device) Listen

func (d *Device) Listen()

func (*Device) Send

func (d *Device) Send(t protocol.PackageType, b interface{}) error

type TcpClient

type TcpClient struct {
	Conn   net.Conn
	Server *TcpServer
	// contains filtered or unexported fields
}

Client holds info about connection

type TcpServer

type TcpServer struct {
	Joins chan *TcpClient
	// contains filtered or unexported fields
}

TCP server

func NewTcpServer

func NewTcpServer(address string) *TcpServer

Creates new tcp server instance

func (*TcpServer) Listen

func (s *TcpServer) Listen()

Start network server

type UdpPackage

type UdpPackage struct {
	RemoteAddress *net.UDPAddr
	Package       *protocol.Package
}

type UdpServer

type UdpServer struct {
	Incoming chan UdpPackage
	// contains filtered or unexported fields
}

func NewUdpServer

func NewUdpServer(addr string) *UdpServer

func (*UdpServer) Listen

func (s *UdpServer) Listen()

Jump to

Keyboard shortcuts

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