return new Platform();
Platform.get().configureTlsExtensions( sslSocket, address.url().host(), address.protocols()); ? Platform.get().getSelectedProtocol(sslSocket) : null; socket = sslSocket; } finally { if (sslSocket != null) { Platform.get().afterHandshake(sslSocket);
/** Does all the work necessary to build a full HTTP or HTTPS connection on a raw socket. */ private void connectSocket(int connectTimeout, int readTimeout, int writeTimeout, ConnectionSpecSelector connectionSpecSelector) throws IOException { rawSocket.setSoTimeout(readTimeout); try { Platform.get().connectSocket(rawSocket, route.socketAddress(), connectTimeout); } catch (ConnectException e) { throw new ConnectException("Failed to connect to " + route.socketAddress()); } source = Okio.buffer(Okio.source(rawSocket)); sink = Okio.buffer(Okio.sink(rawSocket)); if (route.address().sslSocketFactory() != null) { connectTls(readTimeout, writeTimeout, connectionSpecSelector); } else { protocol = Protocol.HTTP_1_1; socket = rawSocket; } if (protocol == Protocol.SPDY_3 || protocol == Protocol.HTTP_2) { socket.setSoTimeout(0); // Framed connection timeouts are set per-stream. FramedConnection framedConnection = new FramedConnection.Builder(true) .socket(socket, route.address().url().host(), source, sink) .protocol(protocol) .build(); framedConnection.sendConnectionPreface(); // Only assign the framed connection once the preface has been sent successfully. this.framedConnection = framedConnection; } }
Platform.get().configureTlsExtensions( sslSocket, address.url().host(), address.protocols()); ? Platform.get().getSelectedProtocol(sslSocket) : null; socket = sslSocket; } finally { if (sslSocket != null) { Platform.get().afterHandshake(sslSocket);
/** Does all the work necessary to build a full HTTP or HTTPS connection on a raw socket. */ private void connectSocket(int connectTimeout, int readTimeout, int writeTimeout, ConnectionSpecSelector connectionSpecSelector) throws IOException { rawSocket.setSoTimeout(readTimeout); try { Platform.get().connectSocket(rawSocket, route.socketAddress(), connectTimeout); } catch (ConnectException e) { throw new ConnectException("Failed to connect to " + route.socketAddress()); } source = Okio.buffer(Okio.source(rawSocket)); sink = Okio.buffer(Okio.sink(rawSocket)); if (route.address().sslSocketFactory() != null) { connectTls(readTimeout, writeTimeout, connectionSpecSelector); } else { protocol = Protocol.HTTP_1_1; socket = rawSocket; } if (protocol == Protocol.SPDY_3 || protocol == Protocol.HTTP_2) { socket.setSoTimeout(0); // Framed connection timeouts are set per-stream. FramedConnection framedConnection = new FramedConnection.Builder(true) .socket(socket, route.address().url().host(), source, sink) .protocol(protocol) .build(); framedConnection.sendConnectionPreface(); // Only assign the framed connection once the preface has been sent successfully. this.framedConnection = framedConnection; } }
Platform.get().configureTlsExtensions( sslSocket, address.url().host(), address.protocols()); ? Platform.get().getSelectedProtocol(sslSocket) : null; socket = sslSocket; } finally { if (sslSocket != null) { Platform.get().afterHandshake(sslSocket);
rawSocket.setSoTimeout(readTimeout); try { Platform.get().connectSocket(rawSocket, route.socketAddress(), connectTimeout); } catch (ConnectException e) { throw new ConnectException("Failed to connect to " + route.socketAddress());
return new Platform();
return new Platform();