epollclient

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 3 Imported by: 1

README

epollclient

Documentation

Index

Constants

View Source
const (
	DEFAULT_KEEPALIVE     = 1
	DEFAULT_BUFFER_LENGTH = 4096
	DEFAULT_TIMEOUT       = 6
	DEFAULT_KEEP_CNT      = 2
	DEFAULT_KEEP_INTVL    = 8
)

Variables

This section is empty.

Functions

func Read

func Read(fd int, msg []byte) (int, error)

func Write

func Write(fd int, msg []byte) (int, error)

Types

type Conn

type Conn struct {
	Id   uint64
	Fd   int
	Data interface{} // external data
}

type Connections

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

func New

func New(host string, port int, capacity int) *Connections

func (*Connections) Close

func (c *Connections) Close(conn *Conn) error

func (*Connections) Get

func (c *Connections) Get() (*Conn, error)

func (*Connections) Put

func (c *Connections) Put(conn *Conn)

func (*Connections) Reconnect

func (c *Connections) Reconnect(conn *Conn) error

func (*Connections) SetBufferLength

func (c *Connections) SetBufferLength(n int)

func (*Connections) SetKeepAlive

func (c *Connections) SetKeepAlive(n int)

func (*Connections) SetKeepCnt

func (c *Connections) SetKeepCnt(n int)

func (*Connections) SetKeepIntvl

func (c *Connections) SetKeepIntvl(n int)

func (*Connections) SetTimeout

func (c *Connections) SetTimeout(n int)

Jump to

Keyboard shortcuts

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