pub struct Ep3 { /* private fields */ }Expand description
Tx5 endpoint version 3.
Implementations§
Source§impl Ep3
impl Ep3
Sourcepub async fn new(config: Arc<Config3>) -> (Self, EventRecv<Ep3Event>)
pub async fn new(config: Arc<Config3>) -> (Self, EventRecv<Ep3Event>)
Construct a new tx5 endpoint version 3.
Sourcepub async fn listen(&self, sig_url: SigUrl) -> Result<PeerUrl>
pub async fn listen(&self, sig_url: SigUrl) -> Result<PeerUrl>
Establish a listening connection to a signal server, from which we can accept incoming remote connections. Returns the client url at which this endpoint may now be addressed.
Sourcepub fn ban(&self, rem_id: Id, span: Duration)
pub fn ban(&self, rem_id: Id, span: Duration)
Close down all connections to, fail all outgoing messages to, and drop all incoming messages from, the given remote id, for the specified ban time period.
Sourcepub fn close(&self, peer_url: PeerUrl) -> Result<()>
pub fn close(&self, peer_url: PeerUrl) -> Result<()>
Request that the peer connection identified by the given peer_url is closed.
Sourcepub async fn send(&self, peer_url: PeerUrl, data: &[u8]) -> Result<()>
pub async fn send(&self, peer_url: PeerUrl, data: &[u8]) -> Result<()>
Send data to a remote on this tx5 endpoint. The future returned from this method will resolve when the data is handed off to our networking backend.
Sourcepub async fn broadcast(&self, data: &[u8])
pub async fn broadcast(&self, data: &[u8])
Broadcast data to all connections that happen to be open. If no connections are open, no data will be broadcast. The future returned from this method will resolve when all broadcast messages have been handed off to our networking backend (or have timed out).