Results 1 to 5 of 5
- 08-22-2009, 07:39 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 50
- Rep Power
- 0
connection timed out in my java code
dear sir
i have develped my GUI,it has two buttons such as start-tx-rx and stop.
once i press the start-tx-rx ,continously recevice the data ,my c code always in listen mode.after one hour i am getting connection timed out message and stops the connection.
thanks
santhosh
- 08-22-2009, 07:44 AM #2
Member
- Join Date
- Feb 2009
- Posts
- 50
- Rep Power
- 0
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?
- 09-07-2009, 05:59 AM #3
Member
- Join Date
- Feb 2009
- Posts
- 50
- Rep Power
- 0
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?
- 10-22-2009, 12:08 PM #4
Member
- Join Date
- Feb 2009
- Posts
- 50
- Rep Power
- 0
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?
- 10-22-2009, 12:24 PM #5
Member
- Join Date
- Feb 2009
- Posts
- 50
- Rep Power
- 0
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
-
Convert java code to midlet code
By coldvoice05 in forum New To JavaReplies: 1Last Post: 08-12-2009, 11:14 AM -
Timed alerts in JTable
By Hikari in forum New To JavaReplies: 2Last Post: 01-03-2009, 12:50 AM -
Transaction has timed out due to no client activity for greater than {1} seconds
By Sayed in forum Advanced JavaReplies: 1Last Post: 06-30-2008, 07:14 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