tls support

This commit is contained in:
eskimo
2024-10-03 13:55:00 -04:00
parent 7e77833452
commit 3280dfaa58
4 changed files with 38 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ export interface SocketsPlugin {
connect(options: { id: string; }): Promise<void>;
send(options: { id: string; message: string }): Promise<void>;
disconnect(options: { id: string }): Promise<void>;
close(options: { id: string }): Promise<void>;
addListener(eventName: "state", listenerFunc: (message: { id: string; state: string }) => void): Promise<PluginListenerHandle>;
addListener(eventName: "message", listenerFunc: (message: { id: string; message: string }) => void): Promise<PluginListenerHandle>;

View File

@@ -98,7 +98,10 @@ export default class Socket {
Sockets.disconnect({
id: this.id,
});
}
close() {
this.disconnect();
SocketManager.getInstance().unregisterSocket(this);
}