1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-24 04:02:07 +03:00

Connected after everything is initialized

This commit is contained in:
lingming.yb
2014-01-09 11:10:39 +08:00
parent 2a05908124
commit ed2ee02570

View File

@@ -109,7 +109,6 @@ public final class Connection implements Closeable {
throws IOException {
if (connected) throw new IllegalStateException("already connected");
connected = true;
socket = (route.proxy.type() != Proxy.Type.HTTP) ? new Socket(route.proxy) : new Socket();
Platform.get().connectSocket(socket, route.inetSocketAddress, connectTimeout);
socket.setSoTimeout(readTimeout);
@@ -121,6 +120,7 @@ public final class Connection implements Closeable {
} else {
streamWrapper();
}
connected = true;
}
/**