@streamr/dht 0.0.1-tatum.7 → 0.0.1-tatum.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/connection/ConnectionLockRpcRemote.d.ts +10 -0
- package/dist/src/connection/{RemoteConnectionLocker.js → ConnectionLockRpcRemote.js} +20 -35
- package/dist/src/connection/ConnectionLockRpcRemote.js.map +1 -0
- package/dist/src/connection/ConnectionManager.d.ts +0 -1
- package/dist/src/connection/ConnectionManager.js +27 -25
- package/dist/src/connection/ConnectionManager.js.map +1 -1
- package/dist/src/connection/ConnectivityChecker.js +4 -4
- package/dist/src/connection/ConnectivityChecker.js.map +1 -1
- package/dist/src/connection/ConnectorFacade.d.ts +1 -1
- package/dist/src/connection/ConnectorFacade.js +5 -8
- package/dist/src/connection/ConnectorFacade.js.map +1 -1
- package/dist/src/connection/Handshaker.d.ts +1 -2
- package/dist/src/connection/Handshaker.js +1 -4
- package/dist/src/connection/Handshaker.js.map +1 -1
- package/dist/src/connection/ManagedConnection.d.ts +1 -2
- package/dist/src/connection/ManagedConnection.js +4 -5
- package/dist/src/connection/ManagedConnection.js.map +1 -1
- package/dist/src/connection/ManagedWebRtcConnection.d.ts +1 -1
- package/dist/src/connection/ManagedWebRtcConnection.js +2 -2
- package/dist/src/connection/ManagedWebRtcConnection.js.map +1 -1
- package/dist/src/connection/Simulator/SimulatorConnector.d.ts +1 -2
- package/dist/src/connection/Simulator/SimulatorConnector.js +3 -4
- package/dist/src/connection/Simulator/SimulatorConnector.js.map +1 -1
- package/dist/src/connection/WebRTC/NodeWebRtcConnection.d.ts +1 -1
- package/dist/src/connection/WebRTC/{WebRtcConnector.d.ts → WebRtcConnectorRpcLocal.d.ts} +9 -9
- package/dist/src/connection/WebRTC/{WebRtcConnector.js → WebRtcConnectorRpcLocal.js} +38 -30
- package/dist/src/connection/WebRTC/WebRtcConnectorRpcLocal.js.map +1 -0
- package/dist/src/connection/WebRTC/WebRtcConnectorRpcRemote.d.ts +11 -0
- package/dist/src/connection/WebRTC/WebRtcConnectorRpcRemote.js +55 -0
- package/dist/src/connection/WebRTC/WebRtcConnectorRpcRemote.js.map +1 -0
- package/dist/src/connection/WebRTC/iceServerAsString.d.ts +1 -1
- package/dist/src/connection/WebSocket/{WebSocketConnector.d.ts → WebSocketConnectorRpcLocal.d.ts} +6 -7
- package/dist/src/connection/WebSocket/{WebSocketConnector.js → WebSocketConnectorRpcLocal.js} +20 -20
- package/dist/src/connection/WebSocket/WebSocketConnectorRpcLocal.js.map +1 -0
- package/dist/src/connection/WebSocket/WebSocketConnectorRpcRemote.d.ts +8 -0
- package/dist/src/connection/WebSocket/{RemoteWebSocketConnector.js → WebSocketConnectorRpcRemote.js} +11 -16
- package/dist/src/connection/WebSocket/WebSocketConnectorRpcRemote.js.map +1 -0
- package/dist/src/dht/DhtNode.d.ts +6 -7
- package/dist/src/dht/DhtNode.js +22 -23
- package/dist/src/dht/DhtNode.js.map +1 -1
- package/dist/src/dht/{RemoteExternalApi.d.ts → ExternalApiRpcRemote.d.ts} +2 -2
- package/dist/src/dht/{RemoteExternalApi.js → ExternalApiRpcRemote.js} +5 -6
- package/dist/src/dht/ExternalApiRpcRemote.js.map +1 -0
- package/dist/src/dht/discovery/PeerDiscovery.d.ts +1 -1
- package/dist/src/dht/discovery/PeerDiscovery.js +3 -2
- package/dist/src/dht/discovery/PeerDiscovery.js.map +1 -1
- package/dist/src/dht/find/RecursiveFindSession.d.ts +5 -5
- package/dist/src/dht/find/RecursiveFindSession.js +7 -7
- package/dist/src/dht/find/RecursiveFindSession.js.map +1 -1
- package/dist/src/dht/find/RecursiveFinder.d.ts +7 -7
- package/dist/src/dht/find/RecursiveFinder.js +24 -24
- package/dist/src/dht/find/RecursiveFinder.js.map +1 -1
- package/dist/src/dht/find/RemoteRecursiveFindSession.d.ts +1 -1
- package/dist/src/dht/find/RemoteRecursiveFindSession.js +4 -4
- package/dist/src/dht/find/RemoteRecursiveFindSession.js.map +1 -1
- package/dist/src/dht/registerExternalApiRpcMethods.js +4 -3
- package/dist/src/dht/registerExternalApiRpcMethods.js.map +1 -1
- package/dist/src/dht/routing/Router.d.ts +2 -2
- package/dist/src/dht/routing/Router.js +2 -4
- package/dist/src/dht/routing/Router.js.map +1 -1
- package/dist/src/dht/routing/{RemoteRouter.d.ts → RouterRpcRemote.d.ts} +2 -2
- package/dist/src/dht/routing/{RemoteRouter.js → RouterRpcRemote.js} +4 -4
- package/dist/src/dht/routing/RouterRpcRemote.js.map +1 -0
- package/dist/src/dht/routing/RoutingSession.js +2 -2
- package/dist/src/dht/routing/RoutingSession.js.map +1 -1
- package/dist/src/dht/store/{DataStore.d.ts → StoreRpcLocal.d.ts} +4 -4
- package/dist/src/dht/store/{DataStore.js → StoreRpcLocal.js} +27 -27
- package/dist/src/dht/store/StoreRpcLocal.js.map +1 -0
- package/dist/src/dht/store/{RemoteStore.d.ts → StoreRpcRemote.d.ts} +2 -2
- package/dist/src/dht/store/{RemoteStore.js → StoreRpcRemote.js} +4 -4
- package/dist/src/dht/store/StoreRpcRemote.js.map +1 -0
- package/dist/src/exports.d.ts +1 -1
- package/dist/src/helpers/protoClasses.js +2 -2
- package/dist/src/helpers/protoClasses.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +29 -29
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +39 -39
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +49 -158
- package/dist/src/proto/packages/dht/protos/DhtRpc.js +46 -86
- package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +15 -15
- package/dist/src/transport/RoutingRpcCommunicator.js +1 -0
- package/dist/src/transport/RoutingRpcCommunicator.js.map +1 -1
- package/package.json +4 -4
- package/protos/DhtRpc.proto +30 -59
- package/src/connection/ConnectionLockRpcRemote.ts +62 -0
- package/src/connection/ConnectionManager.ts +33 -32
- package/src/connection/ConnectivityChecker.ts +1 -1
- package/src/connection/ConnectorFacade.ts +7 -10
- package/src/connection/Handshaker.ts +0 -5
- package/src/connection/ManagedConnection.ts +3 -6
- package/src/connection/ManagedWebRtcConnection.ts +0 -2
- package/src/connection/Simulator/SimulatorConnector.ts +2 -7
- package/src/connection/WebRTC/NodeWebRtcConnection.ts +1 -1
- package/src/connection/WebRTC/{WebRtcConnector.ts → WebRtcConnectorRpcLocal.ts} +46 -34
- package/src/connection/WebRTC/WebRtcConnectorRpcRemote.ts +71 -0
- package/src/connection/WebRTC/iceServerAsString.ts +1 -1
- package/src/connection/WebSocket/{WebSocketConnector.ts → WebSocketConnectorRpcLocal.ts} +26 -26
- package/src/connection/WebSocket/{RemoteWebSocketConnector.ts → WebSocketConnectorRpcRemote.ts} +13 -18
- package/src/dht/DhtNode.ts +32 -33
- package/src/dht/{RemoteExternalApi.ts → ExternalApiRpcRemote.ts} +3 -4
- package/src/dht/discovery/PeerDiscovery.ts +4 -3
- package/src/dht/find/RecursiveFindSession.ts +11 -11
- package/src/dht/find/RecursiveFinder.ts +29 -30
- package/src/dht/find/RemoteRecursiveFindSession.ts +6 -6
- package/src/dht/registerExternalApiRpcMethods.ts +7 -4
- package/src/dht/routing/Router.ts +4 -6
- package/src/dht/routing/{RemoteRouter.ts → RouterRpcRemote.ts} +2 -2
- package/src/dht/routing/RoutingSession.ts +6 -6
- package/src/dht/store/{DataStore.ts → StoreRpcLocal.ts} +31 -31
- package/src/dht/store/{RemoteStore.ts → StoreRpcRemote.ts} +2 -2
- package/src/exports.ts +1 -1
- package/src/helpers/protoClasses.ts +4 -4
- package/src/proto/packages/dht/protos/DhtRpc.client.ts +54 -54
- package/src/proto/packages/dht/protos/DhtRpc.server.ts +15 -15
- package/src/proto/packages/dht/protos/DhtRpc.ts +76 -210
- package/src/transport/RoutingRpcCommunicator.ts +1 -0
- package/test/integration/{RemoteRouter.test.ts → RouterRpcRemote.test.ts} +8 -8
- package/test/integration/{RemoteStore.test.ts → StoreRpcRemote.test.ts} +13 -13
- package/test/integration/WebRtcConnectorRpc.test.ts +11 -24
- package/test/integration/WebSocketConnectorRpc.test.ts +8 -12
- package/test/unit/RecursiveFinder.test.ts +5 -6
- package/test/unit/{WebSocketConnector.test.ts → WebSocketConnectorRpcLocal.test.ts} +3 -3
- package/test/unit/webrtcReplaceInternalIpWithExternalIp.test.ts +1 -1
- package/test/utils/utils.ts +16 -26
- package/dist/src/connection/RemoteConnectionLocker.d.ts +0 -13
- package/dist/src/connection/RemoteConnectionLocker.js.map +0 -1
- package/dist/src/connection/WebRTC/RemoteWebrtcConnector.d.ts +0 -12
- package/dist/src/connection/WebRTC/RemoteWebrtcConnector.js +0 -74
- package/dist/src/connection/WebRTC/RemoteWebrtcConnector.js.map +0 -1
- package/dist/src/connection/WebRTC/WebRtcConnector.js.map +0 -1
- package/dist/src/connection/WebSocket/RemoteWebSocketConnector.d.ts +0 -9
- package/dist/src/connection/WebSocket/RemoteWebSocketConnector.js.map +0 -1
- package/dist/src/connection/WebSocket/WebSocketConnector.js.map +0 -1
- package/dist/src/dht/RemoteExternalApi.js.map +0 -1
- package/dist/src/dht/routing/RemoteRouter.js.map +0 -1
- package/dist/src/dht/store/DataStore.js.map +0 -1
- package/dist/src/dht/store/RemoteStore.js.map +0 -1
- package/src/connection/RemoteConnectionLocker.ts +0 -85
- package/src/connection/WebRTC/RemoteWebrtcConnector.ts +0 -93
package/protos/DhtRpc.proto
CHANGED
|
@@ -14,40 +14,40 @@ service DhtRpcService {
|
|
|
14
14
|
rpc leaveNotice (LeaveNotice) returns (google.protobuf.Empty);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
service
|
|
17
|
+
service RouterRpc {
|
|
18
18
|
rpc routeMessage (RouteMessageWrapper) returns (RouteMessageAck);
|
|
19
19
|
rpc forwardMessage (RouteMessageWrapper) returns (RouteMessageAck);
|
|
20
20
|
rpc findRecursively (RouteMessageWrapper) returns (RouteMessageAck);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
service
|
|
23
|
+
service StoreRpc {
|
|
24
24
|
rpc storeData (StoreDataRequest) returns (StoreDataResponse);
|
|
25
25
|
rpc migrateData (MigrateDataRequest) returns (MigrateDataResponse);
|
|
26
26
|
rpc deleteData (DeleteDataRequest) returns (DeleteDataResponse);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
service RecursiveFindSessionService {
|
|
30
|
-
rpc
|
|
30
|
+
rpc sendFindResponse(FindResponse) returns (google.protobuf.Empty);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
service
|
|
33
|
+
service WebSocketConnectorRpc {
|
|
34
34
|
rpc requestConnection (WebSocketConnectionRequest) returns (WebSocketConnectionResponse);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
service
|
|
37
|
+
service WebRtcConnectorRpc {
|
|
38
38
|
rpc requestConnection (WebRtcConnectionRequest) returns (google.protobuf.Empty);
|
|
39
39
|
rpc rtcOffer (RtcOffer) returns (google.protobuf.Empty);
|
|
40
40
|
rpc rtcAnswer (RtcAnswer) returns (google.protobuf.Empty);
|
|
41
41
|
rpc iceCandidate (IceCandidate) returns (google.protobuf.Empty);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
service
|
|
44
|
+
service ConnectionLockRpc {
|
|
45
45
|
rpc lockRequest (LockRequest) returns (LockResponse);
|
|
46
46
|
rpc unlockRequest (UnlockRequest) returns (google.protobuf.Empty);
|
|
47
47
|
rpc gracefulDisconnect (DisconnectNotice) returns (DisconnectNoticeResponse);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
service
|
|
50
|
+
service ExternalApiRpc {
|
|
51
51
|
rpc findData (FindDataRequest) returns (FindDataResponse);
|
|
52
52
|
rpc externalStoreData (ExternalStoreDataRequest) returns (ExternalStoreDataResponse);
|
|
53
53
|
}
|
|
@@ -111,18 +111,13 @@ message ClosestPeersResponse {
|
|
|
111
111
|
string requestId = 2;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
message FindRequest {
|
|
115
|
+
string sessionId = 1;
|
|
116
|
+
bool fetchData = 2;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
message
|
|
120
|
-
|
|
121
|
-
FindMode findMode = 2;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
message RecursiveFindReport {
|
|
125
|
-
repeated PeerDescriptor nodes = 1;
|
|
119
|
+
message FindResponse {
|
|
120
|
+
repeated PeerDescriptor closestConnectedPeers = 1;
|
|
126
121
|
repeated DataEntry dataEntries = 2;
|
|
127
122
|
optional bool noCloserNodesFound = 3;
|
|
128
123
|
repeated PeerDescriptor routingPath = 4;
|
|
@@ -180,10 +175,8 @@ message RouteMessageWrapper {
|
|
|
180
175
|
}
|
|
181
176
|
|
|
182
177
|
message RouteMessageAck {
|
|
183
|
-
|
|
184
|
-
string
|
|
185
|
-
PeerDescriptor destinationPeer = 3;
|
|
186
|
-
string error = 4;
|
|
178
|
+
string requestId = 1;
|
|
179
|
+
string error = 2;
|
|
187
180
|
}
|
|
188
181
|
|
|
189
182
|
// Correspond to the MessageType Enum
|
|
@@ -203,15 +196,13 @@ message ConnectivityResponse {
|
|
|
203
196
|
|
|
204
197
|
message HandshakeRequest {
|
|
205
198
|
bytes sourceId = 1;
|
|
206
|
-
|
|
207
|
-
PeerDescriptor peerDescriptor = 3;
|
|
199
|
+
PeerDescriptor peerDescriptor = 2;
|
|
208
200
|
}
|
|
209
201
|
|
|
210
202
|
message HandshakeResponse {
|
|
211
203
|
bytes sourceId = 1;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
optional string responseError = 4;
|
|
204
|
+
PeerDescriptor peerDescriptor = 2;
|
|
205
|
+
optional string responseError = 3;
|
|
215
206
|
}
|
|
216
207
|
|
|
217
208
|
// Wraps all messages
|
|
@@ -237,7 +228,7 @@ message Message {
|
|
|
237
228
|
HandshakeRequest handshakeRequest = 8;
|
|
238
229
|
HandshakeResponse handshakeResponse = 9;
|
|
239
230
|
protorpc.RpcMessage rpcMessage = 10;
|
|
240
|
-
|
|
231
|
+
FindRequest findRequest = 11;
|
|
241
232
|
};
|
|
242
233
|
}
|
|
243
234
|
|
|
@@ -245,58 +236,42 @@ message Message {
|
|
|
245
236
|
|
|
246
237
|
// WebSocket
|
|
247
238
|
message WebSocketConnectionRequest {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
string ip = 3;
|
|
251
|
-
uint32 port = 4;
|
|
239
|
+
string ip = 1;
|
|
240
|
+
uint32 port = 2;
|
|
252
241
|
}
|
|
253
242
|
|
|
254
243
|
message WebSocketConnectionResponse {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
bool accepted = 3;
|
|
258
|
-
optional string reason = 4;
|
|
244
|
+
bool accepted = 1;
|
|
245
|
+
optional string reason = 2;
|
|
259
246
|
}
|
|
260
247
|
|
|
261
248
|
// WebRTC
|
|
262
249
|
message WebRtcConnectionRequest {
|
|
263
|
-
|
|
264
|
-
PeerDescriptor target = 2;
|
|
265
|
-
string connectionId = 3;
|
|
250
|
+
string connectionId = 1;
|
|
266
251
|
}
|
|
267
252
|
|
|
268
253
|
message RtcOffer {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
string description = 3;
|
|
272
|
-
string connectionId = 4;
|
|
254
|
+
string description = 1;
|
|
255
|
+
string connectionId = 2;
|
|
273
256
|
}
|
|
274
257
|
|
|
275
258
|
message RtcAnswer {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
string description = 3;
|
|
279
|
-
string connectionId = 4;
|
|
259
|
+
string description = 1;
|
|
260
|
+
string connectionId = 2;
|
|
280
261
|
}
|
|
281
262
|
|
|
282
263
|
message IceCandidate {
|
|
283
264
|
string candidate = 1;
|
|
284
265
|
string mid = 2;
|
|
285
266
|
string connectionId = 3;
|
|
286
|
-
PeerDescriptor requester = 4;
|
|
287
|
-
PeerDescriptor target = 5;
|
|
288
267
|
}
|
|
289
268
|
|
|
290
269
|
message LockRequest {
|
|
291
|
-
string
|
|
292
|
-
PeerDescriptor peerDescriptor = 2;
|
|
293
|
-
string serviceId = 3;
|
|
270
|
+
string serviceId = 1;
|
|
294
271
|
}
|
|
295
272
|
|
|
296
273
|
message UnlockRequest {
|
|
297
|
-
string
|
|
298
|
-
PeerDescriptor peerDescriptor = 2;
|
|
299
|
-
string serviceId = 3;
|
|
274
|
+
string serviceId = 1;
|
|
300
275
|
}
|
|
301
276
|
|
|
302
277
|
message LockResponse {
|
|
@@ -310,18 +285,14 @@ enum DisconnectMode {
|
|
|
310
285
|
}
|
|
311
286
|
|
|
312
287
|
message DisconnectNotice {
|
|
313
|
-
|
|
314
|
-
PeerDescriptor peerDescriptor = 2;
|
|
315
|
-
DisconnectMode disconnecMode = 3;
|
|
288
|
+
DisconnectMode disconnectMode = 1;
|
|
316
289
|
}
|
|
317
290
|
|
|
318
291
|
message DisconnectNoticeResponse {
|
|
319
|
-
string protocolVersion = 1;
|
|
320
292
|
}
|
|
321
293
|
|
|
322
294
|
message FindDataRequest {
|
|
323
295
|
bytes kademliaId = 1;
|
|
324
|
-
PeerDescriptor requestor = 2;
|
|
325
296
|
}
|
|
326
297
|
|
|
327
298
|
message FindDataResponse {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Logger } from '@streamr/utils'
|
|
2
|
+
import { ProtoRpcClient } from '@streamr/proto-rpc'
|
|
3
|
+
import { IConnectionLockRpcClient } from '../proto/packages/dht/protos/DhtRpc.client'
|
|
4
|
+
import { LockRequest, UnlockRequest, PeerDescriptor, DisconnectNotice, DisconnectMode } from '../proto/packages/dht/protos/DhtRpc'
|
|
5
|
+
|
|
6
|
+
import * as Err from '../helpers/errors'
|
|
7
|
+
import { keyFromPeerDescriptor } from '../helpers/peerIdFromPeerDescriptor'
|
|
8
|
+
import { Remote } from '../dht/contact/Remote'
|
|
9
|
+
|
|
10
|
+
const logger = new Logger(module)
|
|
11
|
+
|
|
12
|
+
export class ConnectionLockRpcRemote extends Remote<IConnectionLockRpcClient> {
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
ownPeerDescriptor: PeerDescriptor,
|
|
16
|
+
targetPeerDescriptor: PeerDescriptor,
|
|
17
|
+
client: ProtoRpcClient<IConnectionLockRpcClient>
|
|
18
|
+
) {
|
|
19
|
+
super(ownPeerDescriptor, targetPeerDescriptor, 'DUMMY', client)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public async lockRequest(serviceId: string): Promise<boolean> {
|
|
23
|
+
logger.trace(`Requesting locked connection to ${keyFromPeerDescriptor(this.getPeerDescriptor())}`)
|
|
24
|
+
const request: LockRequest = {
|
|
25
|
+
serviceId
|
|
26
|
+
}
|
|
27
|
+
const options = this.formDhtRpcOptions()
|
|
28
|
+
try {
|
|
29
|
+
const res = await this.getClient().lockRequest(request, options)
|
|
30
|
+
return res.accepted
|
|
31
|
+
} catch (err) {
|
|
32
|
+
logger.debug(new Err.ConnectionLocker('Connection lock rejected', err).stack!)
|
|
33
|
+
return false
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public unlockRequest(serviceId: string): void {
|
|
38
|
+
logger.trace(`Requesting connection to be unlocked from ${keyFromPeerDescriptor(this.getPeerDescriptor())}`)
|
|
39
|
+
const request: UnlockRequest = {
|
|
40
|
+
serviceId
|
|
41
|
+
}
|
|
42
|
+
const options = this.formDhtRpcOptions({
|
|
43
|
+
notification: true
|
|
44
|
+
})
|
|
45
|
+
this.getClient().unlockRequest(request, options).catch((_e) => {
|
|
46
|
+
logger.trace('failed to send unlockRequest')
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public async gracefulDisconnect(disconnectMode: DisconnectMode): Promise<void> {
|
|
51
|
+
logger.trace(`Notifying a graceful disconnect to ${keyFromPeerDescriptor(this.getPeerDescriptor())}`)
|
|
52
|
+
const request: DisconnectNotice = {
|
|
53
|
+
disconnectMode
|
|
54
|
+
}
|
|
55
|
+
const options = this.formDhtRpcOptions({
|
|
56
|
+
doNotConnect: true,
|
|
57
|
+
doNotMindStopped: true,
|
|
58
|
+
timeout: 2000
|
|
59
|
+
})
|
|
60
|
+
await this.getClient().gracefulDisconnect(request, options)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -24,14 +24,16 @@ import {
|
|
|
24
24
|
PeerDescriptor,
|
|
25
25
|
UnlockRequest
|
|
26
26
|
} from '../proto/packages/dht/protos/DhtRpc'
|
|
27
|
-
import {
|
|
27
|
+
import { ConnectionLockRpcClient } from '../proto/packages/dht/protos/DhtRpc.client'
|
|
28
28
|
import { DisconnectionType, ITransport, TransportEvents } from '../transport/ITransport'
|
|
29
29
|
import { RoutingRpcCommunicator } from '../transport/RoutingRpcCommunicator'
|
|
30
30
|
import { ConnectionLockHandler } from './ConnectionLockHandler'
|
|
31
31
|
import { ConnectorFacade } from './ConnectorFacade'
|
|
32
32
|
import { ManagedConnection, Events as ManagedConnectionEvents } from './ManagedConnection'
|
|
33
|
-
import {
|
|
33
|
+
import { ConnectionLockRpcRemote } from './ConnectionLockRpcRemote'
|
|
34
34
|
import { WEB_RTC_CLEANUP } from './WebRTC/NodeWebRtcConnection'
|
|
35
|
+
import { ServerCallContext } from '@protobuf-ts/runtime-rpc'
|
|
36
|
+
import { DhtCallContext } from '../rpc-protocol/DhtCallContext'
|
|
35
37
|
|
|
36
38
|
export interface ConnectionManagerConfig {
|
|
37
39
|
maxConnections?: number
|
|
@@ -109,7 +111,6 @@ export const keyOrUnknownFromPeerDescriptor = (peerDescriptor: PeerDescriptor |
|
|
|
109
111
|
|
|
110
112
|
export class ConnectionManager extends EventEmitter<Events> implements ITransport, ConnectionLocker {
|
|
111
113
|
|
|
112
|
-
public static PROTOCOL_VERSION = '1.0'
|
|
113
114
|
private config: ConnectionManagerConfig
|
|
114
115
|
private readonly metricsContext: MetricsContext
|
|
115
116
|
private readonly duplicateMessageDetector: DuplicateDetector = new DuplicateDetector(100000, 100)
|
|
@@ -142,11 +143,11 @@ export class ConnectionManager extends EventEmitter<Events> implements ITranspor
|
|
|
142
143
|
rpcRequestTimeout: 10000
|
|
143
144
|
})
|
|
144
145
|
this.rpcCommunicator.registerRpcMethod(LockRequest, LockResponse, 'lockRequest',
|
|
145
|
-
(req: LockRequest) => this.lockRequest(req))
|
|
146
|
+
(req: LockRequest, context: ServerCallContext) => this.lockRequest(req, context))
|
|
146
147
|
this.rpcCommunicator.registerRpcNotification(UnlockRequest, 'unlockRequest',
|
|
147
|
-
(req: UnlockRequest) => this.unlockRequest(req))
|
|
148
|
+
(req: UnlockRequest, context: ServerCallContext) => this.unlockRequest(req, context))
|
|
148
149
|
this.rpcCommunicator.registerRpcMethod(DisconnectNotice, DisconnectNoticeResponse, 'gracefulDisconnect',
|
|
149
|
-
(req: DisconnectNotice) => this.gracefulDisconnect(req))
|
|
150
|
+
(req: DisconnectNotice, context: ServerCallContext) => this.gracefulDisconnect(req, context))
|
|
150
151
|
}
|
|
151
152
|
|
|
152
153
|
public garbageCollectConnections(maxConnections: number, lastUsedLimit: number): void {
|
|
@@ -464,14 +465,13 @@ export class ConnectionManager extends EventEmitter<Events> implements ITranspor
|
|
|
464
465
|
return
|
|
465
466
|
}
|
|
466
467
|
const peerIdKey = keyFromPeerDescriptor(targetDescriptor)
|
|
467
|
-
const
|
|
468
|
+
const rpcRemote = new ConnectionLockRpcRemote(
|
|
468
469
|
this.getOwnPeerDescriptor(),
|
|
469
470
|
targetDescriptor,
|
|
470
|
-
|
|
471
|
-
toProtoRpcClient(new ConnectionLockerClient(this.rpcCommunicator!.getRpcClientTransport()))
|
|
471
|
+
toProtoRpcClient(new ConnectionLockRpcClient(this.rpcCommunicator!.getRpcClientTransport()))
|
|
472
472
|
)
|
|
473
473
|
this.locks.addLocalLocked(peerIdKey, serviceId)
|
|
474
|
-
|
|
474
|
+
rpcRemote.lockRequest(serviceId)
|
|
475
475
|
.then((_accepted) => logger.trace('LockRequest successful'))
|
|
476
476
|
.catch((err) => { logger.debug(err) })
|
|
477
477
|
}
|
|
@@ -482,14 +482,13 @@ export class ConnectionManager extends EventEmitter<Events> implements ITranspor
|
|
|
482
482
|
}
|
|
483
483
|
const peerIdKey = keyFromPeerDescriptor(targetDescriptor)
|
|
484
484
|
this.locks.removeLocalLocked(peerIdKey, serviceId)
|
|
485
|
-
const
|
|
485
|
+
const rpcRemote = new ConnectionLockRpcRemote(
|
|
486
486
|
this.getOwnPeerDescriptor(),
|
|
487
487
|
targetDescriptor,
|
|
488
|
-
|
|
489
|
-
toProtoRpcClient(new ConnectionLockerClient(this.rpcCommunicator!.getRpcClientTransport()))
|
|
488
|
+
toProtoRpcClient(new ConnectionLockRpcClient(this.rpcCommunicator!.getRpcClientTransport()))
|
|
490
489
|
)
|
|
491
490
|
if (this.connections.has(peerIdKey)) {
|
|
492
|
-
|
|
491
|
+
rpcRemote.unlockRequest(serviceId)
|
|
493
492
|
}
|
|
494
493
|
}
|
|
495
494
|
|
|
@@ -546,16 +545,15 @@ export class ConnectionManager extends EventEmitter<Events> implements ITranspor
|
|
|
546
545
|
|
|
547
546
|
private async doGracefullyDisconnectAsync(targetDescriptor: PeerDescriptor, disconnectMode: DisconnectMode): Promise<void> {
|
|
548
547
|
logger.trace(keyFromPeerDescriptor(targetDescriptor) + ' gracefullyDisconnectAsync()')
|
|
549
|
-
const
|
|
548
|
+
const rpcRemote = new ConnectionLockRpcRemote(
|
|
550
549
|
this.getOwnPeerDescriptor(),
|
|
551
550
|
targetDescriptor,
|
|
552
|
-
|
|
553
|
-
toProtoRpcClient(new ConnectionLockerClient(this.rpcCommunicator!.getRpcClientTransport()))
|
|
551
|
+
toProtoRpcClient(new ConnectionLockRpcClient(this.rpcCommunicator!.getRpcClientTransport()))
|
|
554
552
|
)
|
|
555
553
|
try {
|
|
556
|
-
await
|
|
554
|
+
await rpcRemote.gracefulDisconnect(disconnectMode)
|
|
557
555
|
} catch (ex) {
|
|
558
|
-
logger.trace(keyFromPeerDescriptor(targetDescriptor) + '
|
|
556
|
+
logger.trace(keyFromPeerDescriptor(targetDescriptor) + ' remote.gracefulDisconnect() failed' + ex)
|
|
559
557
|
}
|
|
560
558
|
}
|
|
561
559
|
|
|
@@ -565,10 +563,11 @@ export class ConnectionManager extends EventEmitter<Events> implements ITranspor
|
|
|
565
563
|
.map((managedConnection: ManagedConnection) => managedConnection.getPeerDescriptor()!)
|
|
566
564
|
}
|
|
567
565
|
|
|
568
|
-
//
|
|
569
|
-
private async lockRequest(lockRequest: LockRequest): Promise<LockResponse> {
|
|
570
|
-
const
|
|
571
|
-
|
|
566
|
+
// ConnectionLockRpc local RPC method
|
|
567
|
+
private async lockRequest(lockRequest: LockRequest, context: ServerCallContext): Promise<LockResponse> {
|
|
568
|
+
const senderPeerDescriptor = (context as DhtCallContext).incomingSourceDescriptor!
|
|
569
|
+
const remotePeerId = peerIdFromPeerDescriptor(senderPeerDescriptor)
|
|
570
|
+
if (areEqualPeerDescriptors(senderPeerDescriptor, this.getOwnPeerDescriptor())) {
|
|
572
571
|
const response: LockResponse = {
|
|
573
572
|
accepted: false
|
|
574
573
|
}
|
|
@@ -581,21 +580,23 @@ export class ConnectionManager extends EventEmitter<Events> implements ITranspor
|
|
|
581
580
|
return response
|
|
582
581
|
}
|
|
583
582
|
|
|
584
|
-
//
|
|
585
|
-
private async unlockRequest(unlockRequest: UnlockRequest): Promise<Empty> {
|
|
586
|
-
const
|
|
583
|
+
// ConnectionLockRpc local RPC method
|
|
584
|
+
private async unlockRequest(unlockRequest: UnlockRequest, context: ServerCallContext): Promise<Empty> {
|
|
585
|
+
const senderPeerDescriptor = (context as DhtCallContext).incomingSourceDescriptor!
|
|
586
|
+
const peerIdKey = keyFromPeerDescriptor(senderPeerDescriptor)
|
|
587
587
|
this.locks.removeRemoteLocked(peerIdKey, unlockRequest.serviceId)
|
|
588
588
|
return {}
|
|
589
589
|
}
|
|
590
590
|
|
|
591
|
-
//
|
|
592
|
-
private async gracefulDisconnect(disconnectNotice: DisconnectNotice): Promise<Empty> {
|
|
593
|
-
|
|
591
|
+
// ConnectionLockRpc local RPC method
|
|
592
|
+
private async gracefulDisconnect(disconnectNotice: DisconnectNotice, context: ServerCallContext): Promise<Empty> {
|
|
593
|
+
const senderPeerDescriptor = (context as DhtCallContext).incomingSourceDescriptor!
|
|
594
|
+
logger.trace(keyOrUnknownFromPeerDescriptor(senderPeerDescriptor) + ' received gracefulDisconnect notice')
|
|
594
595
|
|
|
595
|
-
if (disconnectNotice.
|
|
596
|
-
this.closeConnection(
|
|
596
|
+
if (disconnectNotice.disconnectMode === DisconnectMode.LEAVING) {
|
|
597
|
+
this.closeConnection(senderPeerDescriptor, 'INCOMING_GRACEFUL_LEAVE', 'graceful leave notified')
|
|
597
598
|
} else {
|
|
598
|
-
this.closeConnection(
|
|
599
|
+
this.closeConnection(senderPeerDescriptor, 'INCOMING_GRACEFUL_DISCONNECT', 'graceful disconnect notified')
|
|
599
600
|
}
|
|
600
601
|
return {}
|
|
601
602
|
}
|
|
@@ -10,7 +10,7 @@ import { ClientWebSocket } from './WebSocket/ClientWebSocket'
|
|
|
10
10
|
import { v4 } from 'uuid'
|
|
11
11
|
import { NatType } from './ConnectionManager'
|
|
12
12
|
import { ServerWebSocket } from './WebSocket/ServerWebSocket'
|
|
13
|
-
import { connectivityMethodToWebSocketUrl } from './WebSocket/
|
|
13
|
+
import { connectivityMethodToWebSocketUrl } from './WebSocket/WebSocketConnectorRpcLocal'
|
|
14
14
|
|
|
15
15
|
const logger = new Logger(module)
|
|
16
16
|
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
PeerDescriptor
|
|
5
5
|
} from '../proto/packages/dht/protos/DhtRpc'
|
|
6
6
|
import { ITransport } from '../transport/ITransport'
|
|
7
|
-
import {
|
|
7
|
+
import { PortRange, TlsCertificate } from './ConnectionManager'
|
|
8
8
|
import { ManagedConnection } from './ManagedConnection'
|
|
9
9
|
import { Simulator } from './Simulator/Simulator'
|
|
10
10
|
import { SimulatorConnector } from './Simulator/SimulatorConnector'
|
|
11
|
-
import { IceServer,
|
|
12
|
-
import {
|
|
11
|
+
import { IceServer, WebRtcConnectorRpcLocal } from './WebRTC/WebRtcConnectorRpcLocal'
|
|
12
|
+
import { WebSocketConnectorRpcLocal } from './WebSocket/WebSocketConnectorRpcLocal'
|
|
13
13
|
|
|
14
14
|
export interface ConnectorFacade {
|
|
15
15
|
createConnection: (peerDescriptor: PeerDescriptor) => ManagedConnection
|
|
@@ -44,8 +44,8 @@ export class DefaultConnectorFacade implements ConnectorFacade {
|
|
|
44
44
|
|
|
45
45
|
private readonly config: DefaultConnectorFacadeConfig
|
|
46
46
|
private ownPeerDescriptor?: PeerDescriptor
|
|
47
|
-
private webSocketConnector?:
|
|
48
|
-
private webrtcConnector?:
|
|
47
|
+
private webSocketConnector?: WebSocketConnectorRpcLocal
|
|
48
|
+
private webrtcConnector?: WebRtcConnectorRpcLocal
|
|
49
49
|
|
|
50
50
|
constructor(config: DefaultConnectorFacadeConfig) {
|
|
51
51
|
this.config = config
|
|
@@ -56,8 +56,7 @@ export class DefaultConnectorFacade implements ConnectorFacade {
|
|
|
56
56
|
canConnect: (peerDescriptor: PeerDescriptor) => boolean
|
|
57
57
|
): Promise<void> {
|
|
58
58
|
logger.trace(`Creating WebSocketConnector`)
|
|
59
|
-
this.webSocketConnector = new
|
|
60
|
-
protocolVersion: ConnectionManager.PROTOCOL_VERSION,
|
|
59
|
+
this.webSocketConnector = new WebSocketConnectorRpcLocal({
|
|
61
60
|
transport: this.config.transport!,
|
|
62
61
|
// TODO should we use canConnect also for WebRtcConnector? (NET-1142)
|
|
63
62
|
canConnect: (peerDescriptor: PeerDescriptor) => canConnect(peerDescriptor),
|
|
@@ -69,9 +68,8 @@ export class DefaultConnectorFacade implements ConnectorFacade {
|
|
|
69
68
|
maxMessageSize: this.config.maxMessageSize
|
|
70
69
|
})
|
|
71
70
|
logger.trace(`Creating WebRTCConnector`)
|
|
72
|
-
this.webrtcConnector = new
|
|
71
|
+
this.webrtcConnector = new WebRtcConnectorRpcLocal({
|
|
73
72
|
transport: this.config.transport!,
|
|
74
|
-
protocolVersion: ConnectionManager.PROTOCOL_VERSION,
|
|
75
73
|
iceServers: this.config.iceServers,
|
|
76
74
|
allowPrivateAddresses: this.config.webrtcAllowPrivateAddresses,
|
|
77
75
|
bufferThresholdLow: this.config.webrtcDatachannelBufferThresholdLow,
|
|
@@ -121,7 +119,6 @@ export class SimulatorConnectorFacade implements ConnectorFacade {
|
|
|
121
119
|
async start(onIncomingConnection: (connection: ManagedConnection) => boolean): Promise<void> {
|
|
122
120
|
logger.trace(`Creating SimulatorConnector`)
|
|
123
121
|
this.simulatorConnector = new SimulatorConnector(
|
|
124
|
-
ConnectionManager.PROTOCOL_VERSION,
|
|
125
122
|
this.ownPeerDescriptor,
|
|
126
123
|
this.simulator,
|
|
127
124
|
onIncomingConnection
|
|
@@ -16,17 +16,14 @@ export class Handshaker extends EventEmitter<HandshakerEvents> {
|
|
|
16
16
|
|
|
17
17
|
private static readonly HANDSHAKER_SERVICE_ID = 'system/handshaker'
|
|
18
18
|
private ownPeerDescriptor: PeerDescriptor
|
|
19
|
-
private protocolVersion: string
|
|
20
19
|
private connection: IConnection
|
|
21
20
|
|
|
22
21
|
constructor(
|
|
23
22
|
ownPeerDescriptor: PeerDescriptor,
|
|
24
|
-
protocolVersion: string,
|
|
25
23
|
connection: IConnection
|
|
26
24
|
) {
|
|
27
25
|
super()
|
|
28
26
|
this.ownPeerDescriptor = ownPeerDescriptor
|
|
29
|
-
this.protocolVersion = protocolVersion
|
|
30
27
|
this.connection = connection
|
|
31
28
|
this.connection.on('data', this.onData)
|
|
32
29
|
}
|
|
@@ -57,7 +54,6 @@ export class Handshaker extends EventEmitter<HandshakerEvents> {
|
|
|
57
54
|
public sendHandshakeRequest(): void {
|
|
58
55
|
const outgoingHandshake: HandshakeRequest = {
|
|
59
56
|
sourceId: this.ownPeerDescriptor.kademliaId,
|
|
60
|
-
protocolVersion: this.protocolVersion,
|
|
61
57
|
peerDescriptor: this.ownPeerDescriptor
|
|
62
58
|
}
|
|
63
59
|
const msg: Message = {
|
|
@@ -76,7 +72,6 @@ export class Handshaker extends EventEmitter<HandshakerEvents> {
|
|
|
76
72
|
public sendHandshakeResponse(error?: string): void {
|
|
77
73
|
const outgoingHandshakeResponse: HandshakeResponse = {
|
|
78
74
|
sourceId: this.ownPeerDescriptor.kademliaId,
|
|
79
|
-
protocolVersion: this.protocolVersion,
|
|
80
75
|
peerDescriptor: this.ownPeerDescriptor
|
|
81
76
|
}
|
|
82
77
|
if (error) {
|
|
@@ -45,13 +45,11 @@ export class ManagedConnection extends EventEmitter<Events> {
|
|
|
45
45
|
private closing = false
|
|
46
46
|
public replacedByOtherConnection = false
|
|
47
47
|
private ownPeerDescriptor: PeerDescriptor
|
|
48
|
-
private protocolVersion: string
|
|
49
48
|
protected outgoingConnection?: IConnection
|
|
50
49
|
protected incomingConnection?: IConnection
|
|
51
50
|
|
|
52
51
|
constructor(
|
|
53
52
|
ownPeerDescriptor: PeerDescriptor,
|
|
54
|
-
protocolVersion: string,
|
|
55
53
|
connectionType: ConnectionType,
|
|
56
54
|
outgoingConnection?: IConnection,
|
|
57
55
|
incomingConnection?: IConnection,
|
|
@@ -61,7 +59,6 @@ export class ManagedConnection extends EventEmitter<Events> {
|
|
|
61
59
|
this.send = this.send.bind(this)
|
|
62
60
|
|
|
63
61
|
this.ownPeerDescriptor = ownPeerDescriptor
|
|
64
|
-
this.protocolVersion = protocolVersion
|
|
65
62
|
this.outgoingConnection = outgoingConnection
|
|
66
63
|
this.incomingConnection = incomingConnection
|
|
67
64
|
this.connectionType = connectionType
|
|
@@ -75,7 +72,7 @@ export class ManagedConnection extends EventEmitter<Events> {
|
|
|
75
72
|
}
|
|
76
73
|
|
|
77
74
|
if (outgoingConnection) {
|
|
78
|
-
this.handshaker = new Handshaker(this.ownPeerDescriptor,
|
|
75
|
+
this.handshaker = new Handshaker(this.ownPeerDescriptor, outgoingConnection)
|
|
79
76
|
|
|
80
77
|
this.handshaker.once('handshakeFailed', (errorMessage) => {
|
|
81
78
|
logger.trace(keyOrUnknownFromPeerDescriptor(this.peerDescriptor) + ' handshakeFailed: ' + errorMessage)
|
|
@@ -98,7 +95,7 @@ export class ManagedConnection extends EventEmitter<Events> {
|
|
|
98
95
|
|
|
99
96
|
} else {
|
|
100
97
|
if (incomingConnection) {
|
|
101
|
-
this.handshaker = new Handshaker(this.ownPeerDescriptor,
|
|
98
|
+
this.handshaker = new Handshaker(this.ownPeerDescriptor, incomingConnection)
|
|
102
99
|
this.handshaker.on('handshakeRequest', (peerDescriptor: PeerDescriptor) => {
|
|
103
100
|
this.setPeerDescriptor(peerDescriptor)
|
|
104
101
|
this.emit('handshakeRequest', peerDescriptor)
|
|
@@ -308,7 +305,7 @@ export class ManagedConnection extends EventEmitter<Events> {
|
|
|
308
305
|
// This happens when connectionRequest has been made and answered
|
|
309
306
|
if (this.implementation) {
|
|
310
307
|
if (!this.handshaker) {
|
|
311
|
-
this.handshaker = new Handshaker(this.ownPeerDescriptor, this.
|
|
308
|
+
this.handshaker = new Handshaker(this.ownPeerDescriptor, this.implementation)
|
|
312
309
|
}
|
|
313
310
|
|
|
314
311
|
this.handshaker.sendHandshakeResponse()
|
|
@@ -6,12 +6,10 @@ import { NodeWebRtcConnection } from './WebRTC/NodeWebRtcConnection'
|
|
|
6
6
|
export class ManagedWebRtcConnection extends ManagedConnection {
|
|
7
7
|
|
|
8
8
|
constructor(ownPeerDescriptor: PeerDescriptor,
|
|
9
|
-
protocolVersion: string,
|
|
10
9
|
connectingConnection?: NodeWebRtcConnection,
|
|
11
10
|
connectedConnection?: NodeWebRtcConnection) {
|
|
12
11
|
super(
|
|
13
12
|
ownPeerDescriptor,
|
|
14
|
-
protocolVersion,
|
|
15
13
|
ConnectionType.WEBRTC,
|
|
16
14
|
connectingConnection,
|
|
17
15
|
connectedConnection)
|
|
@@ -16,18 +16,15 @@ export class SimulatorConnector {
|
|
|
16
16
|
|
|
17
17
|
private connectingConnections: Map<PeerIDKey, ManagedConnection> = new Map()
|
|
18
18
|
private stopped = false
|
|
19
|
-
private protocolVersion: string
|
|
20
19
|
private ownPeerDescriptor: PeerDescriptor
|
|
21
20
|
private simulator: Simulator
|
|
22
21
|
private onIncomingConnection: (connection: ManagedConnection) => boolean
|
|
23
22
|
|
|
24
23
|
constructor(
|
|
25
|
-
protocolVersion: string,
|
|
26
24
|
ownPeerDescriptor: PeerDescriptor,
|
|
27
25
|
simulator: Simulator,
|
|
28
26
|
onIncomingConnection: (connection: ManagedConnection) => boolean
|
|
29
27
|
) {
|
|
30
|
-
this.protocolVersion = protocolVersion
|
|
31
28
|
this.ownPeerDescriptor = ownPeerDescriptor
|
|
32
29
|
this.simulator = simulator
|
|
33
30
|
this.onIncomingConnection = onIncomingConnection
|
|
@@ -43,8 +40,7 @@ export class SimulatorConnector {
|
|
|
43
40
|
|
|
44
41
|
const connection = new SimulatorConnection(this.ownPeerDescriptor, targetPeerDescriptor, ConnectionType.SIMULATOR_CLIENT, this.simulator)
|
|
45
42
|
|
|
46
|
-
const managedConnection = new ManagedConnection(this.ownPeerDescriptor,
|
|
47
|
-
ConnectionType.SIMULATOR_CLIENT, connection, undefined)
|
|
43
|
+
const managedConnection = new ManagedConnection(this.ownPeerDescriptor, ConnectionType.SIMULATOR_CLIENT, connection, undefined)
|
|
48
44
|
managedConnection.setPeerDescriptor(targetPeerDescriptor)
|
|
49
45
|
|
|
50
46
|
this.connectingConnections.set(peerKey, managedConnection)
|
|
@@ -72,8 +68,7 @@ export class SimulatorConnector {
|
|
|
72
68
|
const connection = new SimulatorConnection(this.ownPeerDescriptor,
|
|
73
69
|
sourceConnection.ownPeerDescriptor, ConnectionType.SIMULATOR_SERVER, this.simulator)
|
|
74
70
|
|
|
75
|
-
const managedConnection = new ManagedConnection(this.ownPeerDescriptor,
|
|
76
|
-
ConnectionType.SIMULATOR_SERVER, undefined, connection)
|
|
71
|
+
const managedConnection = new ManagedConnection(this.ownPeerDescriptor, ConnectionType.SIMULATOR_SERVER, undefined, connection)
|
|
77
72
|
|
|
78
73
|
logger.trace('connected')
|
|
79
74
|
|
|
@@ -8,7 +8,7 @@ import { IllegalRTCPeerConnectionState } from '../../helpers/errors'
|
|
|
8
8
|
import { keyFromPeerDescriptor } from '../../helpers/peerIdFromPeerDescriptor'
|
|
9
9
|
import { DisconnectionType } from '../../transport/ITransport'
|
|
10
10
|
import { iceServerAsString } from './iceServerAsString'
|
|
11
|
-
import { IceServer } from './
|
|
11
|
+
import { IceServer } from './WebRtcConnectorRpcLocal'
|
|
12
12
|
import { PortRange } from '../ConnectionManager'
|
|
13
13
|
|
|
14
14
|
const logger = new Logger(module)
|