if (connectTimeout == 0) {
socket = socketFactory.createSocket(host, port);
} else {
SocketTask task = new SocketTask() {
public void doit() throws IOException {
setSocket(socketFactory.createSocket(host, port));
}
};
TimeoutController.execute(task, connectTimeout);
socket = task.getSocket();
if (task.exception != null) {