Package org.drasyl.handler.connection
Class ConnectionHandshakeSegment
java.lang.Object
io.netty.buffer.DefaultByteBufHolder
org.drasyl.handler.connection.ConnectionHandshakeSegment
- All Implemented Interfaces:
io.netty.buffer.ByteBufHolder
,io.netty.util.ReferenceCounted
public class ConnectionHandshakeSegment
extends io.netty.buffer.DefaultByteBufHolder
A message used by
ConnectionHandshakeHandler
to perform a handshake.
The synchronization process has been heavily inspired by the three-way handshake of TCP (RFC 793).
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConnectionHandshakeSegment
(long seq, long ack, byte ctl, io.netty.buffer.ByteBuf data) -
Method Summary
Modifier and TypeMethodDescriptionlong
ack()
static ConnectionHandshakeSegment
ack
(long seq, long ack) int
ctl()
boolean
static ConnectionHandshakeSegment
finAck
(long seq, long ack) int
hashCode()
boolean
isAck()
boolean
isFin()
boolean
boolean
isPsh()
boolean
isRst()
boolean
isSyn()
boolean
isUrg()
static ConnectionHandshakeSegment
pshAck
(long seq, long ack, io.netty.buffer.ByteBuf data) static ConnectionHandshakeSegment
rst
(long seq) static ConnectionHandshakeSegment
rstAck
(long seq, long ack) long
seq()
static ConnectionHandshakeSegment
syn
(long seq) static ConnectionHandshakeSegment
synAck
(long seq, long ack) toString()
Methods inherited from class io.netty.buffer.DefaultByteBufHolder
content, contentToString, copy, duplicate, refCnt, release, release, replace, retain, retain, retainedDuplicate, touch, touch
-
Field Details
-
MIN_SEQ_NO
public static final long MIN_SEQ_NO- See Also:
-
MAX_SEQ_NO
public static final long MAX_SEQ_NO- See Also:
-
-
Constructor Details
-
ConnectionHandshakeSegment
public ConnectionHandshakeSegment(long seq, long ack, byte ctl, io.netty.buffer.ByteBuf data)
-
-
Method Details
-
seq
public long seq() -
ack
public long ack() -
ctl
public int ctl() -
isUrg
public boolean isUrg() -
isAck
public boolean isAck() -
isOnlyAck
public boolean isOnlyAck() -
isPsh
public boolean isPsh() -
isRst
public boolean isRst() -
isSyn
public boolean isSyn() -
isFin
public boolean isFin() -
equals
- Overrides:
equals
in classio.netty.buffer.DefaultByteBufHolder
-
hashCode
public int hashCode()- Overrides:
hashCode
in classio.netty.buffer.DefaultByteBufHolder
-
toString
- Overrides:
toString
in classio.netty.buffer.DefaultByteBufHolder
-
ack
-
rst
-
syn
-
pshAck
-
rstAck
-
synAck
-
finAck
-