SocketTransport constructor

SocketTransport(
  1. String _host,
  2. int _port,
  3. AbstractSerializer _serializer,
  4. int _serializerType, {
  5. dynamic ssl = false,
  6. dynamic allowInsecureCertificates = false,
  7. Object? tlsSecurityContext,
  8. dynamic messageLengthExponent = SocketHelper.maxMessageLengthExponent,
})

This creates a socket transport instance. The messageLengthExponent configures the max message length that will be excepted to be send and received. It is negotiated with the router and may lead into a lower value that messageLengthExponent if the router only supports shorter messages. The message length is calculated by 2^messageLengthExponent

Implementation

SocketTransport(
  this._host,
  this._port,
  this._serializer,
  this._serializerType, {
  ssl = false,
  allowInsecureCertificates = false,
  Object? tlsSecurityContext,
  messageLengthExponent = SocketHelper.maxMessageLengthExponent,
}) : assert(
       _serializerType == SocketHelper.serializationJson ||
           _serializerType == SocketHelper.serializationMsgpack ||
           _serializerType == SocketHelper.serializationCbor,
     ),
     _tlsSecurityContext = tlsSecurityContext {
  _ssl = ssl;
  _allowInsecureCertificates = allowInsecureCertificates;
  _messageLengthExponent = messageLengthExponent;
  installNativeCanonicalBase64Codecs(_serializer);
}