The Dart SDK is currently in experimental status. If you would like to provide feedback, please reach out to us with your suggestions and comments on our Discord.
Dart - websocket.close()
Closes a connection to a websocket
import 'package:nitric_sdk/nitric.dart';
final socket = Nitric.websocket("socket");
await socket.close(connectionId);
Parameters
- Name
connectionId
- Required
- Required
- Type
- String
- Description
The ID of the connection to be closed.
Examples
Close a connection to the websocket on message
import 'package:nitric_sdk/nitric.dart';
final socket = Nitric.websocket("socket");
await socket.close(connectionId);