title: Socket Connection Hanged in Java Swing Application
body: <p>I had created a console application in which i was trying to create a socket connection with the server using</p>
  
  <p>Java Class ServerConnect----</p>
  
  <pre><code>InetAddress hostIpAddress= fnGetHostInetAddress(domainName);  
  System.out.println(hostIpAddress.getHostAddress()+""+hostIpAddress.getHostName());  
  Socket socket = new Socket(hostIpAddress,43);  
  </code></pre>
  
  <p>The console java application properly created the socket connection but...</p>
  
  <p>When i tried to do the same thing through the Swing application i.e by giving call to the function of ServerConnect class for Socket Connection it did not work.
  When i tried to debug the Swing Application the control hanged at line</p>
  
  <pre><code>Socket socket = new Socket(hostIpAddress,43);
  </code></pre>
  
  <p>and did not move further, not even gave any exception.I am using netbeans IDE.
  The above code snippet is written in a function within a thread class ServerConnect which implements runnable interface whose run method gives call to that function.</p>
  
  <p>call to start the thread is given in the actionPerformed method of a button.</p>
  
  <p>Can anybody suggest what might be the problem/error.</p>
  
  <p>Thanks </p>