common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelForwarder

type ChannelForwarder struct {
	InChannel   chan *DataMessage
	OutChannel  chan *DataMessage
	Reader      io.Reader
	Writer      io.Writer
	ChannelOpen bool

	NotifyCousure chan struct{}

	Clients     map[string]*Client
	ClientsLock *sync.Mutex
}

func (*ChannelForwarder) Close

func (c *ChannelForwarder) Close()

func (*ChannelForwarder) ReadInputData

func (c *ChannelForwarder) ReadInputData()

func (*ChannelForwarder) WriteOutputData

func (c *ChannelForwarder) WriteOutputData()

type Client

type Client struct {
	Id string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(id string, conn net.Conn, outChannel chan *DataMessage) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) IsDead

func (c *Client) IsDead() bool

func (*Client) NotifyEOF

func (c *Client) NotifyEOF(isDead bool)

func (*Client) ReadFromClientToChannel

func (c *Client) ReadFromClientToChannel()

func (*Client) ReadyToClose

func (c *Client) ReadyToClose() bool

func (*Client) SetReadyToClose

func (c *Client) SetReadyToClose(readyToClose bool)

func (*Client) Terminate

func (c *Client) Terminate()

func (*Client) Write

func (c *Client) Write(data []byte) error

type DataMessage

type DataMessage struct {
	ClientId    string
	CloseClient bool
	DeadClient  bool
	Data        []byte
}

func NewMessage

func NewMessage(clientId string, data []byte) *DataMessage

Jump to

Keyboard shortcuts

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