2024-12-28 19:11:50 +01:00
|
|
|
package daemonconn
|
|
|
|
|
|
|
|
const (
|
|
|
|
MessageTypeEchoRequest = iota
|
|
|
|
MessageTypeEchoResponse
|
2024-12-29 03:06:56 +01:00
|
|
|
MessageTypeEchoUpdate
|
2024-12-28 19:11:50 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type EchoRequest struct {
|
2024-12-29 03:06:56 +01:00
|
|
|
EchoByte byte
|
|
|
|
UpdatesCount byte
|
2024-12-28 19:11:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (EchoRequest) TypeID() uint32 {
|
|
|
|
return MessageTypeEchoRequest
|
|
|
|
}
|
|
|
|
|
2024-12-29 03:06:56 +01:00
|
|
|
type EchoResponse struct {
|
|
|
|
EchoByte byte
|
|
|
|
}
|
2024-12-28 19:11:50 +01:00
|
|
|
|
|
|
|
func (EchoResponse) TypeID() uint32 {
|
|
|
|
return MessageTypeEchoResponse
|
|
|
|
}
|
2024-12-29 03:06:56 +01:00
|
|
|
|
|
|
|
// EchoUpdate should be sent from the side, which received EchoRequest
|
|
|
|
// UpdatesCount times (which is specified in the EchoRequest message)
|
|
|
|
type EchoUpdate struct {
|
|
|
|
EchoByte byte
|
|
|
|
}
|
|
|
|
|
|
|
|
func (EchoUpdate) TypeID() uint32 {
|
|
|
|
return MessageTypeEchoUpdate
|
|
|
|
}
|