communication

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package communication is responsible for all data exchange handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeConnection

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

BridgeConnection is used to wrap underlying connections with server and client.

func NewBridgeConnection

func NewBridgeConnection(
	srcConn,
	dstConn net.Conn,
	analysisChan analysis.Aggregation,
	errChan chan error,
) *BridgeConnection

NewBridgeConnection returns a new BridgeConnection that forwards connections from source to destination and vice versa.

func (*BridgeConnection) Bind

func (b *BridgeConnection) Bind()

Bind starts the binding between the server and client connections.

type Listener

type Listener struct {
	Listener net.Listener
	// contains filtered or unexported fields
}

Listener is used to wrap an underlying listener.

func NewListener

func NewListener(listener net.Listener, errorChan chan error) *Listener

NewListener allocates and returns and Listener.

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

Accept waits for and returns the next connection to the listener.

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

Addr returns the underlying listener's network address.

func (*Listener) AwaitForConnections

func (l *Listener) AwaitForConnections(clientConnChan chan<- net.Conn)

AwaitForConnections blocks on new connections, and when getting one it passes it to the provided channel.

func (*Listener) Close

func (l *Listener) Close() error

Close closes the underlying listener.

Jump to

Keyboard shortcuts

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