mirror of
https://github.com/nvms/prsm.git
synced 2025-12-18 17:00:53 +00:00
28 lines
534 B
TypeScript
28 lines
534 B
TypeScript
import { CommandClient } from "../client/commandclient";
|
|
import { CodeError } from "../common/codeerror";
|
|
|
|
const client = new CommandClient({
|
|
host: "localhost",
|
|
port: 3351,
|
|
secure: false,
|
|
});
|
|
|
|
const payload = { things: "stuff", numbers: [1, 2, 3] };
|
|
|
|
async function main() {
|
|
const callback = (result: any, error: CodeError) => {
|
|
if (error) {
|
|
console.log("ERR [0]", error.code);
|
|
return;
|
|
}
|
|
|
|
console.log("RECV [0]", result);
|
|
client.close();
|
|
};
|
|
|
|
client.command(0, payload, 10, callback);
|
|
|
|
}
|
|
|
|
main();
|