Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
soundofspace committed May 2, 2024
1 parent f56cb40 commit 68795bd
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions agent/main/lib/WebsocketTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,6 @@ import * as WebSocket from 'ws';
import EventSubscriber from '@ulixee/commons/lib/EventSubscriber';
import IConnectionTransport from '../interfaces/IConnectionTransport';


// export class PortTransport implements IConnectionTransport {
// isClosed = false;

// connectedPromise = new Resolvable<void>();
// client: any;

// public onMessageFn: (message: string) => void;
// public readonly onCloseFns: (() => void)[] = [];

// constructor(urlPromise: Promise<string>) {
// urlPromise
// .then(url => this.connect(url))
// .catch(error => {
// if (!this.connectedPromise.isResolved) this.connectedPromise.reject(error);
// });
// }

// send(message: string): boolean {
// if (this.client) {
// this.client.send(message);
// return true;
// }
// return false;
// }

// close(): void {
// if (this.isClosed) return;
// this.isClosed = true;
// }

// private emit(message): void {
// if (this.onMessageFn) {
// setImmediate(this.onMessageFn, message);
// }
// }

// private onData(message: string): void {
// this.emit(message);
// }

// private connect(url: string): void {
// const client = new WebSocket(url);

// client.onerror = () => {
// if (!this.connectedPromise.isResolved)
// this.connectedPromise.reject(new Error('Failed to connect'));
// };
// client.onopen = () => {
// this.client = client;
// client.onmessage = e => {
// const msgData = e.data;
// this.onData(msgData);
// };
// if (!this.connectedPromise.isResolved) this.connectedPromise.resolve();
// };
// }
// }

const { log } = Log(module);

export class WebsocketTransport implements IConnectionTransport {
Expand Down

0 comments on commit 68795bd

Please sign in to comment.