W
Will Hartung
I have a brain dead Client and equally unsophisticated Server program.
The Client connects to the Server, server pops a thread, and then they have
a simple conversation.
The basic goal of the C/S system is simply to Move Data in order to evaluate
timings and what not for a project.
I don't care WHAT the data is, I just want to move some.
Here's the meat of the Server:
I get the InputStream using:
InputStream is = socket.getInputStream();
My blocksize is 8192.
Then, I run this little loop:
while(totalRcvd != totalCnt) {
int amtToRead = blocksize;
if (amtToRead > (totalCnt - totalRcvd)) {
amtToRead = totalCnt - totalRcvd;
}
int amtRcvd = is.read(buffer, 0, amtToRead);
totalRcvd = totalRcvd + amtRcvd;
}
For a small amount of data, 10240 bytes, this works fine.
When I bump up to 102400 bytes, it hangs about 70% of the way into the total
amount, meanwhile the client thinks that it has completed sending the data
and is awaiting acknowledgment from the server.
If I kill the client at this point, then the sockets are closed and I get an
appropriate exception on the server.
Finally, running the client and server on my windows machine, it works
(though it is not consistent). It consistently fails with the server on a
Solaris 8 machine.
Anyone have any hints why this is hanging up?
Thanx!
Regards,
Will Hartung
([email protected])
The Client connects to the Server, server pops a thread, and then they have
a simple conversation.
The basic goal of the C/S system is simply to Move Data in order to evaluate
timings and what not for a project.
I don't care WHAT the data is, I just want to move some.
Here's the meat of the Server:
I get the InputStream using:
InputStream is = socket.getInputStream();
My blocksize is 8192.
Then, I run this little loop:
while(totalRcvd != totalCnt) {
int amtToRead = blocksize;
if (amtToRead > (totalCnt - totalRcvd)) {
amtToRead = totalCnt - totalRcvd;
}
int amtRcvd = is.read(buffer, 0, amtToRead);
totalRcvd = totalRcvd + amtRcvd;
}
For a small amount of data, 10240 bytes, this works fine.
When I bump up to 102400 bytes, it hangs about 70% of the way into the total
amount, meanwhile the client thinks that it has completed sending the data
and is awaiting acknowledgment from the server.
If I kill the client at this point, then the sockets are closed and I get an
appropriate exception on the server.
Finally, running the client and server on my windows machine, it works
(though it is not consistent). It consistently fails with the server on a
Solaris 8 machine.
Anyone have any hints why this is hanging up?
Thanx!
Regards,
Will Hartung
([email protected])