I whipped up some code to help out with a little logging, but surprisingly often it crashes with
java.io.IOException: Socket Closed in the line commented with
CRASH HERE. I've wrapped everything carefully to make sure the socket should be in good shape, but even though it apparently is connected, it's considered closed in the line after. How is this even possible? Am I missing something obvious?
...
If socket.Connected Then
astream.Initialize(Null, socket.OutputStream, "logThis") ' <-- CRASH HERE
data = (text & CRLF).GetBytes("UTF8")
astream.Write(data)
Else
Log("logThis: COULD NOT CONNECT")
End If