This is related to
this forum question, but a bit different. I've got a reader thread that connects to a data source via
- new Client(this, "127.0.0.1", 5204)
I'd like to sleep and retry until the other side of the connection is set up. But if it's not set up, I'll get a
- java.net.ConnectException: Connection refused
error. But I don't see a way to catch that error, nor a way to test for the connection before calling new.
I'd be happy to look at the sources for Client, but the link given in the original forum question is broken. To distill this down to two concise questions:
- How do I wait for the server connection to become established?
- Where are the sources for Client?
1