* @return The socket
*/
public Socket createSocket(Proxy proxy) {
if (userFactory instanceof SocketFactory) {
SocketFactory userFactory = (SocketFactory) this.userFactory;
return new TimedSocketWrapper(userFactory.createSocket(proxy));
} else if (proxy == Proxy.NO_PROXY) {
try {
return createSocket();
} catch (IOException e) {
throw new RuntimeException(