💾 Archived View for bbs.geminispace.org › u › skyjake › 1524 captured on 2023-12-28 at 18:23:19. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-14)

➡️ Next capture (2024-02-05)

🚧 View Differences

-=-=-=-=-=-=-

Comment by 🚀 skyjake

Re: "Certain servers are too hasty to respond"

In: s/Gemini

Yeah, this topic is good to note if you're writing a server. Dealing with sockets isn't quite as simple as one would like/expect.

While writing my server I found you will need to read until a CRLF is received (up to 1024 bytes), the client terminates the connection, or there's a timeout because the client never finishes writing a proper request. This timeout situation seems to happen more often than you'd think. If not handled properly, your server will eventually hang waiting for requests to complete.

🚀 skyjake

Jun 04 · 7 months ago

2 Later Comments ↓

🤖 alexlehm · 2023-06-05 at 14:18:

Funny enough, I had an issue like that when writing a misfin server in Java and handled the data received from the socket as it appeared and didn't wait for the \r\n to finish

🦀 jeang3nie · 2023-06-05 at 15:52:

Nice detective work there. That would be a great thing to mention in a "best practices" document for implementors.

Original Post

🌒 s/Gemini

— Here's a capsule that's failing to load in Rosy Crow due to this issue

Certain servers are too hasty to respond — A few servers, when visited in Rosy Crow, will respond with an Invalid URL error. This problem had been a head-scratcher for a bit, but I've found the cause: some servers don't wait for the client's request to finish before they respond to it. The root cause is the result of how the Opal client library makes requests. In order to...

💬 Addison · 3 comments · Jun 04 · 7 months ago