Results 1 to 1 of 1
- 10-03-2009, 07:55 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 50
- Rep Power
- 0
solution for connection timed out
dear sir,
i have implemented a TCP client in java. I'm using the ServerSocket. I always get an
connected with server port no and ip address .here is my code
try
{
Socket socket=new Socket(serverIP,serverport);
// System.out.println("Connected to sever..........");
InputStream in = socket.getInputStream();
OutputStream out = socket.getOutputStream();
for(i=0;i<12;i++)
{
// System.out.println("sendbuffer" + ":" +Integer.toHexString(sendbuffer[i]));
out.write(sendbuffer[i]);
}
try{
Thread.sleep(500);
in.read(recvbuffer);
}catch(Exception e)
{
System.out.println(e);
}
for(i=0;i<33;i++)
{
// System.out.println("recvbuffer" + ":" +Integer.toHexString(recvbuffer[i]));
}
// System.out.println("Socket close..........");
in.close();
out.close();
socket.close();
}catch(IOException e)
{
System.out.println(e);
// JOptionPane.showMessageDialog(null,"please enter ip address");
}
Code:
Exception in thread "main" java.net.ConnectException: Connection timed out
at the client side. This occurs after numerous connections..
can you help me?
Similar Threads
-
connection timed out in my java code
By santhosh_el in forum AWT / SwingReplies: 4Last Post: 10-22-2009, 12:24 PM -
i am getting connection timed out
By santhosh_el in forum NetworkingReplies: 1Last Post: 08-25-2009, 06:57 AM -
Timed alerts in JTable
By Hikari in forum New To JavaReplies: 2Last Post: 01-03-2009, 12:50 AM -
using Java to access a secure webpage, Exception occurred: Connection timed out
By toby in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 08-07-2007, 06:03 AM -
Exception in thread "main" java.net.ConnectException: Connection timed out
By osval in forum Advanced JavaReplies: 1Last Post: 07-27-2007, 10:59 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks