Package akka.remote.artery.tcp
Class TcpFraming
- java.lang.Object
-
- akka.stream.stage.GraphStageWithMaterializedValue<S,NotUsed>
-
- akka.stream.stage.GraphStage<FlowShape<ByteString,T>>
-
- akka.stream.impl.io.ByteStringParser<EnvelopeBuffer>
-
- akka.remote.artery.tcp.TcpFraming
-
- All Implemented Interfaces:
Graph<FlowShape<ByteString,EnvelopeBuffer>,NotUsed>
public class TcpFraming extends ByteStringParser<EnvelopeBuffer>
INTERNAL API
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.stream.impl.io.ByteStringParser
ByteStringParser.ByteReader, ByteStringParser.FinishedParser$, ByteStringParser.ParseResult<T>, ByteStringParser.ParseResult$, ByteStringParser.ParseStep<T>, ByteStringParser.ParsingException, ByteStringParser.ParsingLogic
-
-
Constructor Summary
Constructors Constructor Description TcpFraming(scala.Function0<EventSink> flightRecorderSupplier)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphStageLogic
createLogic(Attributes inheritedAttributes)
static ByteString
encodeConnectionHeader(int streamId)
When establishing the connection this header is sent first.static ByteString
encodeFrameHeader(int frameLength)
Each frame starts with the frame header that contains the length of the frame.static ByteString
Magic()
The first 4 bytes of a new connection must be these0x64 0x75 0x75 0x64
(AKKA).static int
Undefined()
-
Methods inherited from class akka.stream.impl.io.ByteStringParser
CompactionThreshold, initialAttributes, NeedMoreData, shape
-
Methods inherited from class akka.stream.stage.GraphStage
createLogicAndMaterializedValue
-
Methods inherited from class akka.stream.stage.GraphStageWithMaterializedValue
createLogicAndMaterializedValue, traversalBuilder, withAttributes
-
-
-
-
Constructor Detail
-
TcpFraming
public TcpFraming(scala.Function0<EventSink> flightRecorderSupplier)
-
-
Method Detail
-
Undefined
public static int Undefined()
-
Magic
public static ByteString Magic()
The first 4 bytes of a new connection must be these0x64 0x75 0x75 0x64
(AKKA). The purpose of the "magic" is to detect and reject weird (accidental) accesses.- Returns:
- (undocumented)
-
encodeConnectionHeader
public static ByteString encodeConnectionHeader(int streamId)
When establishing the connection this header is sent first. It contains a "magic" and the stream identifier for selecting control, ordinary, large inbound streams.The purpose of the "magic" is to detect and reject weird (accidental) accesses. The magic 4 bytes are
0x64 0x75 0x75 0x64
(AKKA).The streamId
is encoded as 1 byte.
- Parameters:
streamId
- (undocumented)- Returns:
- (undocumented)
-
encodeFrameHeader
public static ByteString encodeFrameHeader(int frameLength)
Each frame starts with the frame header that contains the length of the frame. TheframeLength
is encoded as 4 bytes (little endian).- Parameters:
frameLength
- (undocumented)- Returns:
- (undocumented)
-
createLogic
public GraphStageLogic createLogic(Attributes inheritedAttributes)
- Specified by:
createLogic
in classGraphStage<FlowShape<ByteString,EnvelopeBuffer>>
-
-