SocketHelper class

Constructors

SocketHelper()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

maxMessageLength → int
no setter

Static Methods

buildMessageHeader(int headerType, int messageLength, bool upgradedProtocol) → List<int>
Builds a message header according to a given headerType, messageLength, an the information if it is an upgradedProtocol. If the upgradedProtocol is true the header will have a size of 5 bytes otherwise 4.
getError(int errorCode) → List<int>
getErrorNumber(List<int> message) → int
get the message error number if message is an error.
getInitialHandshake(int messageLengthExponent, int serializerType) → List<int>
Sends a handshake of the morphology 0111 1111 LLLL SSSS RRRR RRRR RRRR RRRR LLLL = 2^(9+0bLLLL), the accepted message length SSSS = 0b0001 = JSON, 0b0010 = MsgPack RRRR are reserved bytes
getMaxMessageSizeExponent(Uint8List message) → int
gets the max message size exponent of the given message
getMaxUpgradeMessageSizeExponent(Uint8List message) → int
gets the max upgrade message size exponent of the given message
getMessageType(Uint8List message, {dynamic offset = 0}) → int
Gets the message type for the given message.
getPayloadLength(Uint8List message, int headerLength, {dynamic offset = 0}) → int
calculates the message payload length for a given headerLength
getPing(bool isUpgradedProtocol) → List<int>
Get a ping message without a body. If the isUpgradedProtocol is true the header will have a size of 5 bytes otherwise 4.
getPong(int pingLength, dynamic isUpgradedProtocol) → List<int>
Get a pong message with a given pingLength. If the isUpgradedProtocol is true the header will have a size of 5 bytes otherwise 4.
getUpgradeHandshake(int messageLengthExponent) → List<int>
Sends an upgrade handshake of the morphology 0011 1111 0000 LLLL LLLL = 2^(25 + LLLL), the accepted max message length If a router does not accept, this upgrade it will respond with an error.
isRawSocket(Uint8List message) → bool
Checks if the passed message initializes the raw socket protocol
isUpgrade(Uint8List message) → bool
Checks if the passed message upgrades the protocoll to connectanum specific large size messages
isValidMessage(Uint8List message) → bool
Checks if the given message is a valid wamp message

Constants

errorMaxConnectionCountExceeded → const int
errorMessageLengthExceeded → const int
errorSerializerNotSupported → const int
errorUseOfReservedBits → const int
maxMessageLengthConnectanumExponent → const int
Compare to the regular wamp definition, connectanum is able to send and receive up to 2^30 octets per message
maxMessageLengthExponent → const int
Default wamp clients can only receive up to 16M of message length (2^24 octets)
messagePing → const int
messagePong → const int
messageWamp → const int
serializationCbor → const int
serializationFlatBuffers → const int
serializationJson → const int
serializationMsgpack → const int
serializationUbJson → const int