serve<C extends ConnectMeClient> method Null safety

Future<ConnectMeServer<C>> serve<C extends ConnectMeClient>(
  1. InternetAddress address,
  2. {int port = 0,
  3. C clientFactory(
    1. ConnectMeSocket
    )?,
  4. int queryTimeout = 30,
  5. dynamic onLog(
    1. String
    )?,
  6. dynamic onError(
    1. String,
    2. [StackTrace]
    )?,
  7. dynamic onConnect(
    1. C
    )?,
  8. dynamic onDisconnect(
    1. C
    )?,
  9. ConnectMeType type = ConnectMeType.ws}
)

Implementation

static Future<ConnectMeServer<C>> serve<C extends ConnectMeClient>(InternetAddress address, {
	int port = 0,
	C Function(ConnectMeSocket)? clientFactory,
	int queryTimeout = 30,
	Function(String)? onLog,
	Function(String, [StackTrace])? onError,
	Function(C)? onConnect,
	Function(C)? onDisconnect,
	ConnectMeType type = ConnectMeType.ws,
}) async {
	final ConnectMeServer<C> server = ConnectMeServer<C>._(address, port, type, clientFactory, queryTimeout, onLog, onError, onConnect, onDisconnect);
	await server.serve();
	return server;
}