← All procedures
server.disconnect
Disconnect from a remote peer
CLI- Package
- @procedures/peer · README
- Path
["server","disconnect"]- CLI
mark server disconnect --connectionId <string>- As data
{"$proc":["server","disconnect"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/peer"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["server","disconnect"], { connectionId: "<connectionId>" });
console.log(JSON.stringify(result));From the command line
$ mark server disconnect --connectionId <string>
As data, in a program
{
"$proc": ["server", "disconnect"],
"input": { "connectionId": "<connectionId>" }
}Input
| Field | Type | Required | Default | Description |
|---|
connectionId | string | yes | | The connection id from server connect |
Output
| Field | Type | Required | Default | Description |
|---|
success | boolean | yes | | True when the connection closed |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"connectionId": {
"type": "string",
"minLength": 1,
"description": "The connection id from server connect"
}
},
"required": [
"connectionId"
]
},
"output": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "True when the connection closed"
}
},
"required": [
"success"
],
"additionalProperties": {}
}
}