oa_gateway_stomp::client

Function connect

Source
pub async fn connect(
    config: &StompConfig,
) -> Result<(FrameReader, FrameWriter), CodecError>
Expand description

Opens TCP, optionally negotiates TLS, sends CONNECT, and waits for CONNECTED.

TCP, the TLS handshake when StompConfig::tls is set, and CONNECTED each use StompConfig::connect_timeout. login is omitted when unset; passcode is sent only when login is set. Nagle is disabled when the socket allows it.

ยงErrors

Returns CodecError::Io on timeout, a refused connect, a failed TLS handshake, a broker ERROR, a close before CONNECTED, or any other first frame.