transit

package
Version: v0.0.0-...-c2cee1d Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize() error

Initialize preps the starting of the transit server. The transit server is a direct TCP pipeline between clients, this is used if all other P2P methods fail and an intermediary is needed after all

func Shutdown

func Shutdown(ctx context.Context) error

Shutdown gracefully closes the transit connections. Returns an error if something failed along the way.

func Start

func Start() error

Start begins the actually listening server and performs connections. This starts a go-routine within it, so this function does not block

Types

type Client

type Client struct {
	SentOK   bool
	GotToken bool
	TokenBuf []byte
	Token    string
	Side     string
	Mood     string

	Buddy *Client
	// contains filtered or unexported fields
}

Client wraps up the net.Conn connection with other local properties describing a client connection to the transit service

func NewClient

func NewClient(con net.Conn) *Client

NewClient returns a new client object pointer

func (*Client) Close

func (c *Client) Close()

Close shutsdown the client connection and frees any resources we may be consuming

func (*Client) HandleConnection

func (c *Client) HandleConnection()

HandleConnection takes over the client connection and starts processing data that comes in from it

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL