1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | import { RepoInfo } from '../core/RepoInfo';
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export declare class Connection {
|
23 | id: string;
|
24 | private repoInfo_;
|
25 | private applicationId_;
|
26 | private appCheckToken_;
|
27 | private authToken_;
|
28 | private onMessage_;
|
29 | private onReady_;
|
30 | private onDisconnect_;
|
31 | private onKill_;
|
32 | lastSessionId?: string;
|
33 | connectionCount: number;
|
34 | pendingDataMessages: unknown[];
|
35 | sessionId: string;
|
36 | private conn_;
|
37 | private healthyTimeout_;
|
38 | private isHealthy_;
|
39 | private log_;
|
40 | private primaryResponsesRequired_;
|
41 | private rx_;
|
42 | private secondaryConn_;
|
43 | private secondaryResponsesRequired_;
|
44 | private state_;
|
45 | private transportManager_;
|
46 | private tx_;
|
47 | |
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | constructor(id: string, repoInfo_: RepoInfo, applicationId_: string | undefined, appCheckToken_: string | undefined, authToken_: string | undefined, onMessage_: (a: {}) => void, onReady_: (a: number, b: string) => void, onDisconnect_: () => void, onKill_: (a: string) => void, lastSessionId?: string);
|
60 | /**
|
61 | * Starts a connection attempt
|
62 | */
|
63 | private start_;
|
64 | private nextTransportId_;
|
65 | private disconnReceiver_;
|
66 | private connReceiver_;
|
67 | /**
|
68 | * @param dataMsg - An arbitrary data message to be sent to the server
|
69 | */
|
70 | sendRequest(dataMsg: object): void;
|
71 | tryCleanupConnection(): void;
|
72 | private onSecondaryControl_;
|
73 | private onSecondaryMessageReceived_;
|
74 | private upgradeIfSecondaryHealthy_;
|
75 | private proceedWithUpgrade_;
|
76 | private onPrimaryMessageReceived_;
|
77 | private onDataMessage_;
|
78 | private onPrimaryResponse_;
|
79 | private onControl_;
|
80 | /**
|
81 | * @param handshake - The handshake data returned from the server
|
82 | */
|
83 | private onHandshake_;
|
84 | private tryStartUpgrade_;
|
85 | private startUpgrade_;
|
86 | private onReset_;
|
87 | private onConnectionEstablished_;
|
88 | private sendPingOnPrimaryIfNecessary_;
|
89 | private onSecondaryConnectionLost_;
|
90 | /**
|
91 | * @param everConnected - Whether or not the connection ever reached a server. Used to determine if
|
92 | * we should flush the host cache
|
93 | */
|
94 | private onConnectionLost_;
|
95 | private onConnectionShutdown_;
|
96 | private sendData_;
|
97 | /**
|
98 | * Cleans up this connection, calling the appropriate callbacks
|
99 | */
|
100 | close(): void;
|
101 | private closeConnections_;
|
102 | }
|