You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding configurable socket through SocketConfig could allow users to change the default heartbeat duration, timeout and message. It is already implemented on the client side.
let handle = enfync::builtin::native::TokioHandle::try_adopt()
.expect("axum server runner only works in a tokio runtime");
let socket = Socket::new(socket, socket_config, handle);
server.accept(socket,self.request,self.address);
})
}
It comes down into three options:
Configuration through Server::create(), global options for all incoming sessions.
Configuration through Session::create(), but it could be a little bit tricky, as Socket is already created when the Session::create() is called.
Configuration through mentioned above on_upgrade_with_config() in case of Axum. It would work only for Axum
First option doesn't seem bad? Unless you want to have different configuration for each of the clients connected to your server, but is it actually necessary?
The text was updated successfully, but these errors were encountered:
Configuration through Server::create(), global options for all incoming sessions.
A global option does not work since you may need different Ping/Pong protocols based on the client (I use a custom ping/pong protocol for WASM clients).
Configuration through Session::create(), but it could be a little bit tricky, as Socket is already created when the Session::create() is called.
Yeah I looked at this option and the structure is not compatible with defining a custom SocketConfig.
Configuration through mentioned above on_upgrade_with_config() in case of Axum. It would work only for Axum
Doing the same for tungstenite is blocked by this issue. Right now we use SocketConfig::default() because there is not a good way to inject logic.
Clients
There is ClientConfig::socket_config() as you noted.
Adding configurable socket through SocketConfig could allow users to change the default heartbeat duration, timeout and message. It is already implemented on the client side.
For tungstenite:
ezsockets/src/server_runners/tungstenite.rs
Lines 63 to 109 in 932eb74
and for Axum, on_upgrade_with_config() function is not used anywhere.
ezsockets/src/server_runners/axum.rs
Lines 149 to 160 in 932eb74
It comes down into three options:
Server::create()
, global options for all incoming sessions.Session::create()
, but it could be a little bit tricky, asSocket
is already created when theSession::create()
is called.on_upgrade_with_config()
in case of Axum. It would work only for AxumFirst option doesn't seem bad? Unless you want to have different configuration for each of the clients connected to your server, but is it actually necessary?
The text was updated successfully, but these errors were encountered: