getUpgradeHandshake static method

List<int> getUpgradeHandshake(
  1. int messageLengthExponent
)

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.

Implementation

static List<int> getUpgradeHandshake(int messageLengthExponent) {
  var upgradeHandShake = Uint8List(2);
  upgradeHandShake[0] = SocketHelper._upgradeHeader;
  upgradeHandShake[1] = (max(0, min(15, messageLengthExponent - 25)) << 4);
  return upgradeHandShake.toList(growable: false);
}