Documentation
¶
Index ¶
Constants ¶
View Source
const ( ErrMsgDropped = errs.Err("message dropped") ErrBrokenPath = errs.Err("bad destination: broken path") ErrInvalidSendType = errs.Err("invalid send type") )
errors
Variables ¶
View Source
var ( // OptionDomains is option's domain OptionDomains = []string{"Socket"} // Options for receiver Options = socketOptions{ NoRecv: options.NewBoolOption(false), RecvQueueSize: options.NewUint16Option(64), NoSend: options.NewBoolOption(false), SendQueueSize: options.NewUint16Option(64), SendTTL: options.NewUint8Option(message.DefaultMsgTTL), SendBestEffort: options.NewBoolOption(false), SendStopTimeout: options.NewTimeDurationOption(5 * time.Second), } )
Functions ¶
func StartSwitch ¶
func StartSwitch(backSock, frontSock Socket, mid SwitchMiddlewareFunc)
StartSwitch start switch messages between back and front sockets
Types ¶
type ConnectorAction ¶
ConnectorAction is connector's actions
type Socket ¶
type Socket interface {
options.Options
ConnectorAction
Connector() connector.Connector
RecvMsg() (*message.Message, error)
SendMsg(msg *message.Message) error // for forward message
Send(content []byte) error // for initiative send one
SendAll(content []byte) error // for initiative send all
SendTo(dest message.MsgPath, content []byte) error // for reply send
Close() error
}
Socket is a network peer
Click to show internal directories.
Click to hide internal directories.
