Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SocketComponent ¶
type SocketComponent struct { component.Component camPluginRouter.RouterPlugin camPluginContext.ContextPlugin // contains filtered or unexported fields }
func (*SocketComponent) GetConfig ¶
func (comp *SocketComponent) GetConfig() *SocketComponentConfig
get config
func (*SocketComponent) Init ¶
func (comp *SocketComponent) Init(configI camBase.ComponentConfigInterface)
init config
type SocketComponentConfig ¶
type SocketComponentConfig struct { component.ComponentConfig camPluginRouter.RouterPluginConfig camPluginContext.ContextPluginConfig // tcp listen port Port uint16 // Block transfer end. // Default: '\x17' // // Example: // recvMessage := "17\x17receive a message" // recvMessage can be divided into three parts: [len], [etb flat], [content] := "17", "\x17", "receive a message" // [len]: the content length // [etb flat]: block transfer end // [content]: actual received data Etb byte // Max number of bytes in a single receive message // Default: 1MB RecvMaxLen uint64 // Max number of bytes in a single send message // Default: 128MB SendMaxLen uint64 // Read recv message timeout RecvTimeout time.Duration // Write send message timeout SendTimeout time.Duration // socket conn handler ConnHandler camBase.SocketConnHandler // message parse handler. // it can read route and values info form the message MessageParseHandler camBase.MessageParseHandler // trace recv and send message Trace bool }
func NewSocketComponentConfig ¶
func NewSocketComponentConfig(port uint16) *SocketComponentConfig
type SocketSession ¶
type SocketSession struct { camBase.SessionInterface // contains filtered or unexported fields }
func NewSocketSession ¶
func NewSocketSession(conn net.Conn) *SocketSession
func (*SocketSession) Get ¶
func (sess *SocketSession) Get(key interface{}) interface{}
get session value
func (*SocketSession) GetSessionId ¶
func (sess *SocketSession) GetSessionId() string
func (*SocketSession) Set ¶
func (sess *SocketSession) Set(key interface{}, value interface{})
set session value
Click to show internal directories.
Click to hide internal directories.