I have a problem to getting a full response when i made a connection with a socket to a
jboss service,because the jboss generates a message1 then after a while generates a message 2,the method readBuffer reads in run mode only the message1 and don't wait for the server to send the message2,but in the debug mode readBuffer reads both message1 and message2.
How can i make my method readBuffer waits for the jboss service to send both message1 and message2 in other words how can i transform the non blocking InputStream is in a blocking one ?
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
............
private Socket s;
private InputStream is;
private OutputStream os;
s = new Socket(host, port);
is = s.getInputStream();
//methode to read from the jboss service.
public readBuffer(byte[] buf)
{
try
{
int size = is.read(buf)
}
catch(Exception e)
{..
}
}
Thank you
Ismail
[ November 28, 2008: Message edited by: ismail hassani ]
[ November 28, 2008: Message edited by: ismail hassani ]
[ November 28, 2008: Message edited by: ismail hassani ]
[ November 28, 2008: Message edited by: ismail hassani ]