equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
163 } else { |
163 } else { |
164 // Still connecting through a proxy |
164 // Still connecting through a proxy |
165 // server & port will be the proxy address and port |
165 // server & port will be the proxy address and port |
166 s = new Socket(Proxy.NO_PROXY); |
166 s = new Socket(Proxy.NO_PROXY); |
167 } |
167 } |
168 } else |
168 } else { |
169 s = createSocket(); |
169 s = createSocket(); |
|
170 } |
|
171 |
170 // Instance specific timeouts do have priority, that means |
172 // Instance specific timeouts do have priority, that means |
171 // connectTimeout & readTimeout (-1 means not set) |
173 // connectTimeout & readTimeout (-1 means not set) |
172 // Then global default timeouts |
174 // Then global default timeouts |
173 // Then no timeout. |
175 // Then no timeout. |
174 if (connectTimeout >= 0) { |
176 if (connectTimeout >= 0) { |
192 * The following method, createSocket, is provided to allow the |
194 * The following method, createSocket, is provided to allow the |
193 * https client to override it so that it may use its socket factory |
195 * https client to override it so that it may use its socket factory |
194 * to create the socket. |
196 * to create the socket. |
195 */ |
197 */ |
196 protected Socket createSocket() throws IOException { |
198 protected Socket createSocket() throws IOException { |
197 return new java.net.Socket(); |
199 return new java.net.Socket(Proxy.NO_PROXY); // direct connection |
198 } |
200 } |
199 |
201 |
200 protected InetAddress getLocalAddress() throws IOException { |
202 protected InetAddress getLocalAddress() throws IOException { |
201 if (serverSocket == null) |
203 if (serverSocket == null) |
202 throw new IOException("not connected"); |
204 throw new IOException("not connected"); |