diff --git a/src/main/scala/li/cil/oc/server/component/InternetCard.scala b/src/main/scala/li/cil/oc/server/component/InternetCard.scala index a13c8912d..b6d2a9551 100644 --- a/src/main/scala/li/cil/oc/server/component/InternetCard.scala +++ b/src/main/scala/li/cil/oc/server/component/InternetCard.scala @@ -329,7 +329,9 @@ object InternetCard { private def checkConnected() = { if (owner.isEmpty) throw new IOException("connection lost") try { - if (isAddressResolved) channel.finishConnect() + if (isAddressResolved) { + channel.finishConnect() + } else if (address.isCancelled) { // I don't think this can ever happen, Justin Case. channel.close() @@ -341,14 +343,15 @@ object InternetCard { case e: ExecutionException => throw e.getCause } isAddressResolved = true - false + // After address resolution, immediately attempt connection + channel.finishConnect() } else false } catch { case t: Throwable => close() - false + throw t // Propagate exception instead of returning false } }