title: Connecting Jenkins slave agent on windows failed with connection timeout
body: <p>Connecting Jenkins slave agent on windows failed with connection timeout.</p>
  
  <p>Environment:
  Windows server 2003 R2
  Java6</p>
  
  <p>Master: Linux
  Slave: Windows</p>
  
  <p>I tried to run it as jnlp and also java -jar cmd but it fails consistently.</p>
  
  <pre><code>INFO: Connecting to [ec2-machine_url]:4317
  5 (retrying:2)
  java.net.ConnectException: Connection timed out: connect
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
          at java.net.Socket.connect(Socket.java:529)
          at java.net.Socket.connect(Socket.java:478)
          at java.net.Socket.&lt;init&gt;(Socket.java:375)
          at java.net.Socket.&lt;init&gt;(Socket.java:189)
          at hudson.remoting.Engine.connect(Engine.java:304)
          at hudson.remoting.Engine.run(Engine.java:193)
  </code></pre>