Documentation ¶
Index ¶
Constants ¶
View Source
const ( PROTOCOL_NAME = "keep-alive" PROTOCOL_ID uint16 = 8 // Time between keep-alive probes, in seconds KEEP_ALIVE_PERIOD = 60 )
View Source
const ( MESSAGE_TYPE_KEEP_ALIVE = 0 MESSAGE_TYPE_KEEP_ALIVE_RESPONSE = 1 MESSAGE_TYPE_DONE = 2 )
Variables ¶
View Source
var ( STATE_CLIENT = protocol.NewState(1, "Client") STATE_SERVER = protocol.NewState(2, "Server") STATE_DONE = protocol.NewState(3, "Done") )
View Source
var StateMap = protocol.StateMap{ STATE_CLIENT: protocol.StateMapEntry{ Agency: protocol.AGENCY_CLIENT, Transitions: []protocol.StateTransition{ { MsgType: MESSAGE_TYPE_KEEP_ALIVE, NewState: STATE_SERVER, }, { MsgType: MESSAGE_TYPE_DONE, NewState: STATE_DONE, }, }, }, STATE_SERVER: protocol.StateMapEntry{ Agency: protocol.AGENCY_SERVER, Transitions: []protocol.StateTransition{ { MsgType: MESSAGE_TYPE_KEEP_ALIVE_RESPONSE, NewState: STATE_CLIENT, }, }, }, STATE_DONE: protocol.StateMapEntry{ Agency: protocol.AGENCY_NONE, }, }
Functions ¶
Types ¶
type KeepAlive ¶
type KeepAlive struct {
// contains filtered or unexported fields
}
func New ¶
func New(options protocol.ProtocolOptions, callbackConfig *KeepAliveCallbackConfig) *KeepAlive
type KeepAliveCallbackConfig ¶
type KeepAliveCallbackConfig struct { KeepAliveFunc KeepAliveFunc KeepAliveResponseFunc KeepAliveResponseFunc DoneFunc DoneFunc }
type KeepAliveResponseFunc ¶
type MsgDone ¶ added in v0.10.0
type MsgDone struct {
protocol.MessageBase
}
type MsgKeepAlive ¶ added in v0.10.0
type MsgKeepAlive struct { protocol.MessageBase Cookie uint16 }
func NewMsgKeepAlive ¶ added in v0.10.0
func NewMsgKeepAlive(cookie uint16) *MsgKeepAlive
type MsgKeepAliveResponse ¶ added in v0.10.0
type MsgKeepAliveResponse struct { protocol.MessageBase Cookie uint16 }
func NewMsgKeepAliveResponse ¶ added in v0.10.0
func NewMsgKeepAliveResponse(cookie uint16) *MsgKeepAliveResponse
Click to show internal directories.
Click to hide internal directories.