Skip to content

Commit

Permalink
close adapter on connection rpc loss
Browse files Browse the repository at this point in the history
  • Loading branch information
Geosearchef committed Oct 21, 2018
1 parent 822d9c3 commit 2bf2ce9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ice-adapter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
// implementation "org.jitsi:ice4j:1.0"
// implementation 'com.github.jitsi:ice4j:59693a4894'
implementation 'com.github.Geosearchef:ice4j:52c8e4bcef'
implementation 'com.github.Geosearchef:JJsonRpc:master'
implementation 'com.github.Geosearchef:JJsonRpc:10a8fbaa26'
implementation "com.google.code.gson:gson:2.7"
implementation "com.google.guava:guava:18.0"
implementation "org.slf4j:slf4j-api:1.7.25"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public static void init() {
tcpServer.start();

debug().rpcStarted(tcpServer.getFirstPeer());
tcpServer.getFirstPeer().thenAccept(firstPeer -> {
firstPeer.onConnectionLost(() -> {
log.info("Lost connection to first RPC Peer. Stopping adapter...");
IceAdapter.close();
});
});
}

public static void onConnectionStateChanged(String newState) {
Expand Down

0 comments on commit 2bf2ce9

Please sign in to comment.