Don't crash if we can't bind to server socket
This commit is contained in:
parent
a857002fa9
commit
f579608f6b
1 changed files with 3 additions and 0 deletions
|
@ -23,6 +23,9 @@ class InternetServerThread(crypto: Crypto, port: Int,
|
|||
}
|
||||
|
||||
override def run(): Unit = {
|
||||
if (socket.isEmpty)
|
||||
return
|
||||
|
||||
try {
|
||||
while (socket.get.isBound) {
|
||||
val connection = new InternetConnectionThread(socket.get.accept(), crypto, onDisconnected, onReceive)
|
||||
|
|
Reference in a new issue