💾 Archived View for bbs.geminispace.org › s › Gemini › 22142 captured on 2024-12-17 at 15:09:22. Gemini links have been rewritten to link to archived content

View Raw

More Information

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

Not sure I understand this line in specification:

Clients SHOULD NOT close a connection by default, but MAY in case the content exceeds constraints set by the user.

https://geminiprotocol.net/docs/protocol-specification.gmi#closing-connections

Why should I keep connection open (on client-side), even the page has been loaded? Maybe just to prevent double handshake only?

Asking, because have some head pain with Rust implementation, where connection get dopped by last reference left the scope. So here simpler to open connection again, than hold and manage connection reference somewhere, e.g. in memory stack.

Just do I understand specification right to begin endless connection implementation?

Thanks

Posted in: s/Gemini

👻 ps

Nov 24 · 3 weeks ago

6 Comments ↓

🐸 HanzBrix · Nov 24 at 14:42:

@ps It basically means a client has to wait for the server to close the connection. As there is no size indicator in the response, this is the only way the client can know that everything was transferred.

User is a bit of a stretch, as it most likely refers to the settings of the client, like Lagrange has a default set of accepted sizes for content, that can be altered by the user.

👻 ps [OP] · Nov 24 at 14:53:

So that's okay my connection get closed after last byte received. Now it looks correct. Maybe will return to this subject later, on media streaming implementation.

@HanzBrix hanks much for explain!

🐸 HanzBrix · Nov 24 at 14:55:

@ps No problem. 😁

It's not after last byte received though, as that would not follow the spec. It is once you get a close signal from the server on the TLS connection.

This behaviour is also what allows the impromptu streaming, but it also allows Gemini clients to load really fast, as they can begin processing the buffer, before they have received everything.

🚀 stack · Nov 24 at 15:15:

How do you know what is the last byte?

👻 ps [OP] · Nov 24 at 15:22:

@HanzBrix ah, exactly! it's just memory kidding me, wrote some gemini servers before, where closed connection after last byte sent. still thinking as server :)

💀 requiem · Nov 25 at 19:56:

Keeping it open is also what enables TCP streaming over Gemini, there was some experimental chat software for it :)