when setting timeout infinite, make sure it is connected first

This commit is contained in:
Jonathan Leibiusky
2012-08-02 16:57:14 -03:00
parent 8f9763a7e9
commit beb999d50a
2 changed files with 11 additions and 0 deletions

View File

@@ -38,6 +38,9 @@ public class Connection {
public void setTimeoutInfinite() {
try {
if(!isConnected()) {
connect();
}
socket.setKeepAlive(true);
socket.setSoTimeout(0);
} catch (SocketException ex) {