Skip to main content

connect_map

Function connect_map 

Source
pub fn connect_map<'a>(
    cfg: &'a Config,
    endpoint: Option<&'a Endpoint>,
    device_override: Option<&'a str>,
) -> Pin<Box<dyn Future<Output = Result<MapClient<Stream>>> + Send + 'a>>
Expand description

Opens a MAP session, connecting via iroh hub or RFCOMM depending on endpoint.

Hub path: connects to the configured hub over MAP_ALPN using the caller-owned endpoint and completes OBEX CONNECT with event notifications enabled. RFCOMM path: identical behaviour to before hub/spoke was introduced. Caller must hold the returned client alive — iOS drops the notification registration on OBEX DISCONNECT.

§Errors

Returns an error if target resolution fails, transport connection fails, or OBEX session establishment fails.