socket problem,,,,, plz help

Reply

Join Date: Oct 2007
Posts: 1
Reputation: ezzat_hakeem is an unknown quantity at this point 
Solved Threads: 0
ezzat_hakeem ezzat_hakeem is offline Offline
Newbie Poster

socket problem,,,,, plz help

 
0
  #1
Oct 21st, 2007
my problem is

I have socket between server and a client
the client sending data to the server, so the server respond to the client with the response
this my code for receive the response data
----------------------------------------------------------
os.write(getAuthenticationRedGreenInfoString());
os.flush();
Thread.sleep(3000);
DataInputStream is = new DataInputStream(mySocket.getInputStream());
int rr;
int nn = is.available();
if(nn > 0)
{
byte[] bb = new byte[100000];
rr = is.read(bb); / / rr is Number of read bytes
}
--------------------------------------------------------------------

look to the code, u can notice that i have 2 variables nn and rr
nn is the avialbe bytes in the InbutStream and
rr is the nubmer of byes did read from the InbutStream.

when i make a debug , nn = 8192 and rr = 22233 !!!!!!!!!!!!!


the question is HOW can I read _ALLl _ the received data from the InbutStream

waiting ur help
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,438
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 510
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: socket problem,,,,, plz help

 
0
  #2
Oct 22nd, 2007
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC