pub struct RemoteConfig {
pub server_address: ServerAddress,
pub channel_name: String,
pub conversation_id: ConversationId,
pub pool_config: ConnectionPoolConfig,
/* private fields */
}Expand description
Configuration for remote SDK handles.
Fields§
§server_address: ServerAddressRemote server address. Remote mode cannot be created without this value.
channel_name: StringApplication-visible channel name.
conversation_id: ConversationIdApplication-visible conversation identifier.
pool_config: ConnectionPoolConfigCaller/runtime-supplied connection pool configuration.
Implementations§
Source§impl RemoteConfig
impl RemoteConfig
Sourcepub fn new(
server_address: impl Into<String>,
channel_name: impl Into<String>,
conversation_id: impl Into<ConversationId>,
pool_config: ConnectionPoolConfig,
) -> Result<Self, SdkError>
pub fn new( server_address: impl Into<String>, channel_name: impl Into<String>, conversation_id: impl Into<ConversationId>, pool_config: ConnectionPoolConfig, ) -> Result<Self, SdkError>
Sourcepub fn connect_tcp(self) -> Result<Self, SdkError>
pub fn connect_tcp(self) -> Result<Self, SdkError>
Opens a real TCP connection to the configured server and installs the live wire transport, replacing the in-process protocol transport.
This performs the protocol handshake (Connect -> ConnectAck) eagerly,
so a returned configuration is already connected to the server. Subsequent
publish, subscribe, and conversation calls traverse the socket.
§Errors
Returns SdkError::Connection when the TCP connection cannot be
established and SdkError::Protocol when the handshake is rejected.
Sourcepub fn connect_tcp_with_auth(self, auth_token: &[u8]) -> Result<Self, SdkError>
pub fn connect_tcp_with_auth(self, auth_token: &[u8]) -> Result<Self, SdkError>
Opens a real TCP connection whose handshake carries auth_token, for a
server gated by an [auth] section, and installs the live wire transport.
Additive to connect_tcp: an empty token behaves identically to it. The
server compares the token during the handshake and closes the connection on
a mismatch, which surfaces here as SdkError::Connection.
§Errors
Returns SdkError::Connection when the TCP connection cannot be
established or the token is rejected, and SdkError::Protocol when the
handshake frames cannot be encoded or sent.
Sourcepub fn connect_websocket(self) -> Result<Self, SdkError>
pub fn connect_websocket(self) -> Result<Self, SdkError>
Opens a real WebSocket connection to the configured ws:// server
address and installs the live wire transport, replacing the in-process
protocol transport.
This performs the WebSocket upgrade and the protocol handshake
(Connect -> ConnectAck) eagerly through the client unit’s typed
permit path, so a returned configuration is already connected.
Subsequent publish, subscribe, and conversation calls traverse the
socket; the concretely typed transport stays reachable through
websocket_transport for the typed
reconnect path.
§Errors
Returns SdkError::Connection when the address is not a usable
ws:// URL, the connection cannot be established, or the handshake is
rejected, and SdkError::Protocol when frames cannot be encoded.
Sourcepub fn connect_websocket_with_auth(
self,
auth_token: &[u8],
) -> Result<Self, SdkError>
pub fn connect_websocket_with_auth( self, auth_token: &[u8], ) -> Result<Self, SdkError>
Opens a real WebSocket connection whose handshake carries
auth_token, for a server gated by an [auth] section, and installs
the live wire transport. Additive to connect_websocket: an empty
token behaves identically to it.
§Errors
Returns SdkError::Connection when the connection cannot be
established or the token is rejected, and SdkError::Protocol when
the handshake frames cannot be encoded or sent.
Sourcepub fn websocket_transport(&self) -> Option<Arc<WebSocketRemoteTransport>>
pub fn websocket_transport(&self) -> Option<Arc<WebSocketRemoteTransport>>
The concretely typed WebSocket transport installed by
connect_websocket, when one is installed.
Trait Implementations§
Source§impl Clone for RemoteConfig
impl Clone for RemoteConfig
Source§fn clone(&self) -> RemoteConfig
fn clone(&self) -> RemoteConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more