Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/main/scala/li/cil/oc/server/component/InternetCard.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
}
}

Expand Down