| | |
socket problem,,,,, plz help
![]() |
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Solved Threads: 0
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
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
![]() |
Similar Threads
- Problem, plz help (C)
- i not understand how i do this problem (C++)
- Problem with newly bought MSI Radeon 9800pro. (Monitors, Displays and Video Cards)
- public pathroom problem (plz help) (Java)
- How can fix the problem? (JavaScript / DHTML / AJAX)
- problem with connection to sql server (ASP.NET)
- Page Cannot Be Displayed/... PLZ HELP? (Windows NT / 2000 / XP)
- weird problem (Troubleshooting Dead Machines)
- A Small Problem ....plz Help Me Out.... (C)
Other Threads in the Java Forum
- Previous Thread: Sql + Java
- Next Thread: Help with subclasses and Methods
| Thread Tools | Search this Thread |
-xlint actionlistener android api applet application array automation bi binary blackberry block bluetooth character class client code compile compiler component consumer database desktop developmenthelp eclipse error fractal freeze ftp functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide image int j2me j2seprojects java javac javaee javaprojects jetbrains jni jpanel jtable julia learningresources lego linked linux mac main map method mobile myregfun netbeans nonstatic notdisplaying number online pearl printf problem program project qt researchinmotion rotatetext rsa scanner screen server set singleton sms sort spamblocker sql string swing system textfields thread threads time title tree tutorial-sample update variablebinding windows working xor






