@Override
		public void run() {
			try {
				while(!Thread.interrupted() ) {
					
					try {
						setupSocket(hostname, portNumber);
					} catch (IOException e1) {
						Thread.sleep(rand.nextInt(1000));
						continue;
					}
				
					int numAttempts = rand.nextInt(10);
					for (int i  =0; i< numAttempts; i++) {
						boolean doClose = i == numAttempts-1;
						try {
							if (tryConnect(hostname, doClose) == false) {
								fails++;
							} else {
								oks++;
							}
							Thread.sleep(rand.nextInt(10));
						} catch (IOException e) {
							System.err.println(e.toString());
							//java.net.ConnectException: Cannot assign requested address
							//https://groups.google.com/forum/#!topic/jvm-languages/E-8QyckBmf4
							exceptions++;
						} catch (InterruptedException e) {
							break;
						}
					}
				
				
					try {
						shutdownSocket();
					} catch (IOException e) {
						
					}
				}
			}  catch (InterruptedException e) {
				//done
			}
		}