aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Java Server limit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Java Server limit" Watch "Java Server limit" New topic
Author

Java Server limit

Daniel Smith
Greenhorn

Joined: Mar 29, 2005
Posts: 5
Greetings,
I am writing a Java Server application using ServerSocket and when a client is sending the app data that is greater then 512 characters the message received is missing the first 512 characters and displays the rest of the message. The only thing that this app does is print to the screen what was received by the client. Any help would be great on how do I fix this problem to display the entire message sent by the client.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Hi, welcome to the ranch!

Could you post a short bit of code around sending and receiving data? I'm curious about what kinds of streams you set up and how you chunk your sends. I dimly recall there are some limits around some of the streams. Maybe seeing your code will trigger some answers.

Since you're on post #1 and haven't submitted code before, I'll point out the CODE button below the editor. It puts open & close tags into the editor. When you put your code inside these, it preserves your indentation.

Cheers!


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Daniel Smith
Greenhorn

Joined: Mar 29, 2005
Posts: 5
Thank you for your reply. The code for the server and client is listed below.

<- Server code ->


<- Client code to send ->


Thanks for your help. Hopefully I did this correctly. If not please let me know.

Thanks,
Dan
Yuan Ye
Ranch Hand

Joined: Mar 05, 2003
Posts: 172
The code looks fine to me, what os are you using on Client and Server? You might want to check your os setting for console input.
Daniel Smith
Greenhorn

Joined: Mar 29, 2005
Posts: 5
Peter,
The OS that this is running on is HP-UX B.11.23 U 9000/800. When I perform a getReceiveBufferSize() it shows me ~32K. When I set the buffer size to ~60K, I still have the problem that I currently have. I am at a loss with this one. I do thank everyone for thier help.

Thanks,
Dan
Daniel Smith
Greenhorn

Joined: Mar 29, 2005
Posts: 5
Everyone, I am still having this issue. I was told that the System.in has a bug. The bug is that it only allows 512 characters at a time. Is this correct? If so, how can I get around this. Please, any help would be wonderful. I am stuck.

Thanks
Daniel Smith
Greenhorn

Joined: Mar 29, 2005
Posts: 5
I have just run the code on my Linux box and it ran fine. I am going to try and run the code on the SUN box I have at work. It seems that the code will not run correctly on the HP box. Any thoughts?
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281
Try using the "flush ()" method after sending 511 characters.


The nice thing about Standards is that there are so many to choose from!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Server limit
 
Similar Threads
Problem Whit Special Characters on server side
Null pointer exception probably due to synchronisation issues; problem in starting activity
Getting error on sending chinese text
chat program
How to pass string from TCP server (a Runnable) to main activity (in Android)?