tcp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func (*Connection) GetDestAddress

func (c *Connection) GetDestAddress() string

func (*Connection) GetMessage

func (c *Connection) GetMessage() string

func (*Connection) GetSourceAddress

func (c *Connection) GetSourceAddress() string

func (*Connection) SendRequest

func (c *Connection) SendRequest(action string, content []byte, callback func(byte []byte))

type DataFormat

type DataFormat struct {
	Id      uint64
	Source  string
	Dest    string
	Action  string
	Content []byte
}

Data Format

type ReplyChannel

type ReplyChannel struct {
	// contains filtered or unexported fields
}

func (*ReplyChannel) GetDestAddress

func (c *ReplyChannel) GetDestAddress() string

func (*ReplyChannel) GetSourceAddress

func (c *ReplyChannel) GetSourceAddress() string

func (*ReplyChannel) SendMessage

func (c *ReplyChannel) SendMessage(action string, content []byte) (n int, err error)

type Transport

type Transport struct {
	LocalAddress    string
	LocalNodeId     string
	SeedHosts       []string
	RequestHandlers map[string]transport.RequestHandler
}

func NewTransport

func NewTransport(port int, seedHost string, nodeId string) *Transport

func (*Transport) GetHandler

func (t *Transport) GetHandler(action string) transport.RequestHandler

func (*Transport) GetLocalAddress

func (t *Transport) GetLocalAddress() string

func (*Transport) GetNodeId

func (t *Transport) GetNodeId() string

func (*Transport) GetSeedHosts

func (t *Transport) GetSeedHosts() []string

func (*Transport) OpenConnection

func (t *Transport) OpenConnection(address string, callback func(conn transport.Connection))

func (*Transport) Register

func (t *Transport) Register(action string, handler transport.RequestHandler)

func (*Transport) Start

func (t *Transport) Start(port int)

Jump to

Keyboard shortcuts

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