17 lines
423 B
TypeScript
17 lines
423 B
TypeScript
import sendData from "../(utils)/send-data";
|
|
import sendError from "../(utils)/send-error";
|
|
import { WebSocketMessageParam } from "../socket-message";
|
|
|
|
export default async function socketClientPing({
|
|
ws,
|
|
data,
|
|
}: WebSocketMessageParam) {
|
|
try {
|
|
sendData(ws, {
|
|
event: "server:ping",
|
|
});
|
|
} catch (error: any) {
|
|
sendError(ws, "Client Ping Error! " + error.message);
|
|
}
|
|
}
|