SocketHelper class
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString ()
→ String
A string representation of this object.
inherited
Static Methods
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 , dynamic offset = 0 })
→ int
calculates the message
payload length for a given headerLength
getPing (dynamic 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