TcpServer constructor

TcpServer(
  1. TcpConfig cfg
)

Implementation

factory TcpServer(TcpConfig cfg) {
  if (cfg.port <= 0 || cfg.port >= 65535) {
    throw ArgumentError('Port must be between 1 and 65534 inclusive');
  }
  if (cfg.proxyProtocolV2) {
    throw ArgumentError('Proxy Protocol v2 is not supported on Dart');
  }
  return TcpServer._(cfg);
}