Documentation ¶
Index ¶
Constants ¶
View Source
const (
// The amount of bytes used for the coo address sent in a handshake packet.
ByteEncodedCooAddressBytesLength = 49
)
View Source
const (
MessageTypeHandshake message.Type = 1
)
Variables ¶
View Source
var (
ErrVersionNotSupported = errors.New("version not supported")
)
View Source
var ( // HandshakeMessageFormat defines a handshake message's format. // Made up of: // - own server socket port (2 bytes) // - time at which the packet was sent (8 bytes) // - own used byte encoded coordinator address (49 bytes) // - own used MWM (1 byte) // - supported protocol versions. we need up to 32 bytes to represent 256 possible protocol // versions. only up to N bytes are used to communicate the highest supported version. HandshakeMessageDefinition = &message.Definition{ ID: MessageTypeHandshake, MaxBytesLength: 92, VariableLength: true, } )
Functions ¶
Types ¶
type Handshake ¶
type Handshake struct { ServerSocketPort uint16 SentTimestamp uint64 ByteEncodedCooAddress []byte MWM byte SupportedVersions []byte }
Handshake defines information exchanged during the handshake phase between two peers.
func ParseHandshake ¶
ParseHandshake parses the given message into a Handshake.
type HeaderState ¶
type HeaderState int32
Click to show internal directories.
Click to hide internal directories.