2023-04-15 22:40:09 +00:00
|
|
|
/// <reference types="node" />
|
2023-04-16 02:17:57 +00:00
|
|
|
import { Callback } from "streamx";
|
2023-04-15 22:40:09 +00:00
|
|
|
import { TcpSocketConnectOpts } from "net";
|
|
|
|
import MultiSocketProxy from "../multiSocket.js";
|
|
|
|
import { PeerEntity } from "./types.js";
|
2023-04-16 02:17:57 +00:00
|
|
|
import Socket, { SocketOptions } from "../../socket.js";
|
|
|
|
export default class DummySocket extends Socket {
|
2023-04-15 22:40:09 +00:00
|
|
|
private _options;
|
|
|
|
private _id;
|
|
|
|
private _proxy;
|
|
|
|
private _connectTimeout?;
|
2023-04-16 02:17:57 +00:00
|
|
|
constructor(id: number, manager: MultiSocketProxy, peer: PeerEntity, connectOptions: TcpSocketConnectOpts, socketOptions: SocketOptions);
|
2023-04-15 22:40:09 +00:00
|
|
|
private _remoteId;
|
|
|
|
set remoteId(value: number);
|
|
|
|
private _peer;
|
|
|
|
get peer(): any;
|
|
|
|
_write(data: any, cb: any): Promise<void>;
|
|
|
|
_destroy(cb: Callback): Promise<void>;
|
|
|
|
connect(): Promise<void>;
|
|
|
|
setTimeout(ms: number, cb: Function): void;
|
|
|
|
}
|