boostorg / boostorg/beast

Better explanation of tcp_stream timeouts and websocket interaction

Aperta
#1,726 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Doc
Lingua principale
C++
Stelle
4.8k
Fork
694
Merge medio
12h 48m
PR unite (30g)
1

Descrizione

https://www.boost.org/doc/libs/1_71_0/libs/beast/doc/html/beast/using_websocket/timeouts.html says

`The timeout features of the TCP or basic stream should not be used when working with a websocket stream.`

and

`The timeouts on the websocket stream are incompatible with the timeouts used in the tcp_stream. When constructing a websocket stream from a tcp stream that has timeouts enabled, the timeout should be disabled first before constructing the websocket stream, as shown.`

I wanted to have a timeout for the "connection" of a protocol over websocket, with the timeout covering all of TCP, SSL, Websocket and over-Websocket.

So I was planning to use the tcp_stream timeout starting with the TCP socket and only stopped after the websocket handshake.

I was planning to disable the WS handshake_timeout, but leaving the WS idle_timeout. But the documentation seems to say I can't. Can the restriction be relaxed?
I am not really sure why it's there. The WS stream needs to be able to work even if the underlying streams report an error and AFAIK an error::timeout is just another error.
Maybe the documentation is just trying to say "your handshake may timeout earlier than expected if there is also a tcp_stream timeout"?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.