Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello there,
I was making a HTTPS server in java from scratch for my school project, and I encountered an error.

I put an upload feature for users and it sends data using multipart/form-data. The problem is that any request over 16384 bytes cannot be fully read, SSLSocket.available() always return 16384, ignoring the rest of the request.

I know that the problem is that DataInputStream.read() doesn't read 'all' packets, SSL buffers the data to 16384 bytes each and sends every packet followed by ACK. Is there any read function that can read continuously from the socket so that it can read the whole packet?


What I have tried:

Replacing DataInputStream with BufferedInputStream
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900