HI All,


I am doing Socket Connection on NokiaS60 emulator....It is working fine for localhost but with another server I am getting 500 internal error..java.net.SocketTimeoutException: Read timed out?
My questions are
1)why the same code is working for my local web server.
2) What can i do abt it?

Thanks



My code and error-report is given below

<html><head><title>Apache Tomcat/5.0.18 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>java.net.SocketTimeoutException: Read timed out
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:777)
org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:807)
org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:740)
org.apache.coyote.Request.doRead(Request.java:469)
org.apache.coyote.tomcat5.InputBuffer.realReadBytes(InputBuffer.java:317)
org.apache.coyote.tomcat5.InputBuffer.realReadChars(InputBuffer.java:369)
org.apache.tomcat.util.buf.CharChunk.substract(CharChunk.java:447)
org.apache.coyote.tomcat5.InputBuffer.read(InputBuffer.java:403)
org.apache.coyote.tomcat5.CoyoteReader.read(CoyoteReader.java:124)
org.apache.coyote.tomcat5.CoyoteReader.readLine(CoyoteReader.java:169)
com.lucent.apb.XCAPServerServlet.processRequest(Unknown Source)
com.lucent.apb.XCAPServerServlet.doPut(Unknown Source)
javax.servlet.http.HttpServlet.service(HttpServlet.java:766)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Tomcat logs.</u></p><HR size="1" noshade><h3>Apache Tomcat/5.0.18</h3></body></html>







SocketConnection sc = ( SocketConnection ) Connector.open(
"socket://ipaddress:8007" );

sc.setSocketOption( SocketConnection.DELAY, 0 );
sc.setSocketOption( SocketConnection.LINGER, 0 );
sc.setSocketOption( SocketConnection.KEEPALIVE, 0 );
PrintStream sout = new PrintStream( sc.openOutputStream() );
InputStream in = sc.openInputStream();
ByteArrayOutputStream out = new ByteArrayOutputStream( 1024 );
byte[] packet = new byte[1024];
int d = 0;

sout.println( "GET /index.html" );
sout.println( "" );
sout.flush();

while ( ( d = in.read( packet ) ) != -1 )
{
out.write( packet, 0, d );
}