mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-22 10:19:27 +00:00
Should not crash app when StateSync fails to bind.
This commit is contained in:
parent
4066ce73a8
commit
7c9e9d5f52
1 changed files with 13 additions and 8 deletions
|
@ -112,6 +112,7 @@ class StateSync {
|
|||
Logger.i(TAG, "Sync key pair initialized (public key = ${publicKey})")
|
||||
|
||||
_thread = Thread {
|
||||
try {
|
||||
val serverSocket = ServerSocket(PORT)
|
||||
_serverSocket = serverSocket
|
||||
|
||||
|
@ -125,6 +126,10 @@ class StateSync {
|
|||
|
||||
session.startAsResponder()
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
Logger.e(TAG, "Failed to bind server socket to port ${PORT}", e)
|
||||
UIDialogs.toast("Failed to start sync, port in use")
|
||||
}
|
||||
}.apply { start() }
|
||||
|
||||
if (Settings.instance.synchronization.connectLast) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue