Record Class HandshakeMessage
java.lang.Object
java.lang.Record
pt.unl.fct.di.novasys.babel2.channels.messages.HandshakeMessage
- Record Components:
identity- the node identity of the sending endpoint
Immutable record exchanged as the very first message on a newly established TCP or QUIC
connection to identify both endpoints to each other.
When a connection becomes active, each side immediately sends a HandshakeMessage
containing its own BabelNode identity. The receiver uses this identity to register
the connection under the canonical address of the remote peer, and uses the node comparator
to resolve simultaneous-connection races (the winning node keeps its outbound connection
while the other side closes its connection).
The message is encoded by TCPSimpleHandshakeCodec
or TCPAuthentitcatedHandshakeCodec (TCP) and
QUICHandshakeCodec (QUIC). Codecs prefix the payload
with a magic number to distinguish handshake frames from regular Babel message frames on the wire.
-
Constructor Summary
ConstructorsConstructorDescriptionHandshakeMessage(BabelNode identity) Creates an instance of aHandshakeMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.identity()Returns the value of theidentityrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HandshakeMessage
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
identity
-