TcpSocketClient constructor

TcpSocketClient({
  1. required dynamic host,
  2. required int port,
  3. dynamic sourceAddress,
  4. int sourcePort = 0,
  5. Duration? timeout,
  6. Map? connectData,
  7. EventEmitter? eventEmitter,
  8. Duration? pingInterval,
  9. String event_socket_invoke = "socket_invoke",
  10. String event_socket_connection = "socket_connection",
  11. String event_socket_update = "socket_update",
})

Implementation

TcpSocketClient({
  required this.host,
  required this.port,
  this.sourceAddress,
  this.sourcePort = 0,
  this.timeout,
  Map? connectData,
  EventEmitter? eventEmitter,
  Duration? pingInterval,
  this.event_socket_invoke = "socket_invoke",
  this.event_socket_connection = "socket_connection",
  this.event_socket_update = "socket_update",
}) {
  pingInterval ??= Duration(seconds: 1);
  ping_interval = pingInterval;
  if (connectData != null) {
    connect_data.addAll(connect_data);
  }
  if (eventEmitter != null) {
    emitter = eventEmitter;
  }
}