common

package
v0.0.0-...-3b74f7b Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 6 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

	NotifyClosure chan struct{}

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

func (*ChannelForwarder) Close

func (c *ChannelForwarder) Close()

func (*ChannelForwarder) KeepAlive

func (c *ChannelForwarder) KeepAlive()

func (*ChannelForwarder) ReadInputData

func (c *ChannelForwarder) ReadInputData()

func (*ChannelForwarder) Terminate

func (c *ChannelForwarder) Terminate()

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
	CloseChannel bool
	KeepAlive    bool
}

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