title: Hudson slaves failing to start on Windows XP: java.net.SocketTimeoutException
body: <p>I have bug troubles (re)starting Hudson slaves on Windows XP machines that are located on a different campus (not so close to the hudson server, still the network speed is decent and reliable - do get ~400-800 KB/s on test).</p>
  
  <p>Hudson server is running on OS X under Tomcat.</p>
  
  <p><code>hudson-slave.err.log</code>:</p>
  
  <pre><code>Exception in thread "main" java.net.SocketTimeoutException: Accept timed out
  at java.net.PlainSocketImpl.socketAccept(Native Method)
  at java.net.PlainSocketImpl.accept(Unknown Source)
  at java.net.ServerSocket.implAccept(Unknown Source)
  at java.net.ServerSocket.accept(Unknown Source)
  at hudson.remoting.Launcher.runAsTcpServer(Launcher.java:303)
  at hudson.remoting.Launcher.run(Launcher.java:202)
  at hudson.remoting.Launcher.main(Launcher.java:167)
  </code></pre>
  
  <p><code>hudson-slave.wrapper.log</code>:</p>
  
  <pre><code>2010-10-11 12:22:18 - Started 3116
  2010-10-12 00:52:11 - Starting javaw.exe -Xrs -jar "d:\.hudson\slave.jar" -tcp         d:\.hudson\port.txt
  2010-10-12 00:52:12 - Started 3312
  2010-10-12 02:12:05 - Starting javaw.exe -Xrs -jar "d:\.hudson\slave.jar" -tcp     d:\.hudson\port.txt
  2010-10-12 02:12:05 - Started 1332
  2010-10-12 02:36:05 - Starting javaw.exe -Xrs -jar "d:\.hudson\slave.jar" -tcp d:\.hudson\port.txt
  2010-10-12 02:36:05 - Started 2972
  2010-10-12 03:56:05 - Starting javaw.exe -Xrs -jar "d:\.hudson\slave.jar" -tcp d:\.hudson\port.txt
  2010-10-12 03:56:05 - Started 632
  </code></pre>
  
  <p>Event log:</p>
  
  <pre>
  Event Type: Warning
  Event Source:   hudsonslave-d__.hudson
  Event Category: None
  Event ID:   0
  Date:       10/12/2010
  Time:       3:56:36 AM
  User:       N/A
  Computer:   GWATANAB370-XP
  Description:
  Child process [632 - javaw.exe -Xrs -jar "d:\.hudson\slave.jar" -tcp d:\.hudson\port.txt] terminated with 1
  </pre>
  
  <p>Another strange thing is that I see that <code>slave.jar</code> file is always incomplete. The one from the server is <code>131131</code> bytes long but the one downloaded to the client is always less than this.</p>
  
  <p>On the node monitor the last step is <code>Copying slave.jar</code> and stays like this forever.</p>
  
  <p>In case it wasn't obvious the node is configured to be started with <code>Let Hudson control this Windows slave as a Windows service</code> option. This seams to me the most reliable method that should be safe even if hudson server or client is rebooted.</p>