socket

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GwHosts

func GwHosts(tp.PullCtx, *struct{}) (*types.GwHosts, *tp.Rerror)

GwHosts returns the gateway seriver hosts.

func InnerPush

func InnerPush(uid string, uri string, args interface{}, bodyCodec byte) *tp.Rerror

InnerPush pushs the message to the designated uid.

func Serve

func Serve(outerSrvCfg, innerSrvCfg ant.SrvConfig, protoFunc socket.ProtoFunc)

Serve starts TCP gateway service.

func TotalConn

func TotalConn() int32

TotalConn returns the long connections total.

Types

type Hosts

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

Hosts gateway ip:port list

func (*Hosts) Name

func (d *Hosts) Name() string

Name returns the plugin name.

func (*Hosts) PostListen

func (d *Hosts) PostListen() error

PostListen starts the Hosts program.

type SortWeightIps

type SortWeightIps []*WeightIp

SortWeightIps IP weight information list for sorting

func (SortWeightIps) Len

func (s SortWeightIps) Len() int

Len is the number of elements in the collection.

func (SortWeightIps) Less

func (s SortWeightIps) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (SortWeightIps) Swap

func (s SortWeightIps) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type WeightIp

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

WeightIp IP information with weight

Jump to

Keyboard shortcuts

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