Hi.,

I am developing application for N95 which uses socket conenction.
The same code which is given below working fine in SonyEricsson where this one is hangs on the read() method.
can you suggest me how to come out from this issue? why the read() method is not executing here or in N95?

is = ((SocketConnection)conn).openInputStream();
private byte[] cbuf = new byte[ 256 ];

private void read() throws IOException
{
synchronized(conn)
{
try{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int read = 0;
nread = 0;

while ( (read = is.read(cbuf)) != -1 )
{
// write buffer into an internal array
baos.write( cbuf, 0, read );
//#if isDebugMode == "true"
System.out.println("Reading " + nread + " bytes over the stream. +"+read);
//#endif
baos.flush();
// todo check if this method always retturns 0
if(is.available() <= 0){
System.out.println("if(is.available() <= 0){");
break;
}
}

response = baos.toString();
}catch (Exception exe){}
}
}

Is there any alternative method for reading byte arrays for S60 devices.?