Java Question HttpServer With ServerSocket & AsyncStreams

Alpay ABAY

Member
Licensed User
I am trying to develope a custom http server based on ServerSocket and AsyncStreams. So far so good, but stuck on most basic issue.
Either I am doing wrong, but I am facing an issue on getting requestbody(bigsize) as chunked.

as far as I read construction is as below should be.

http status
http headers []
<EOL>
http content

I attached BJ project."Click" button and follow log. In AL_HttpConnection module below I have problem.
I wrote in a few different way then I figured out, whatever I do, on first request <EOL> is missing like AStream eats some byte to trash.
After the first request try as much as u want it work how it needs to be, asso if u use other button which make a small byte request first,
after first request everything works.

I really suspect there is a bug a bout ServerSocket, maybe there is some code which I need to add.
This issue is happening also when the request come from curl with php.
I opened this topic after 2 days struggling on this matter. Any assistance will be great!
 

Attachments

  • SocketHttp.zip
    374 KB · Views: 50
  • log.jpg
    144.6 KB · Views: 50
Last edited:

jahswant

Well-Known Member
Licensed User
Longtime User
HAVE YOU TRIED THIS ?

 

Alpay ABAY

Member
Licensed User
Nice project and thank you but I am trying to figure out what is wrong in my code, what is preventing request to be delivered properly.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…