pub fn send_confirmed<T: Into<TParam::TSend>>(
        &mut self,
        socket: &mut dyn Socket,
        msg: T,
    ) -> Result<()> {
        let sending_id = if let Some(id) = self.send.next_message_id {
            id
        } else {
            unsafe { NonZeroU64::new_unchecked(1) }
        };
        let data = Packet::Data {
            data: msg.into(),
            message_id: Some(sending_id),
        };
        send_packet_to(self.peer_addr, socket, &data)?;
        self.send.unconfirmed_message_cache.insert(
            sending_id,
            CachedPacket {
                packet: data,
                last_emit: Instant::now(),
            },
        );
        self.send.next_message_id = NonZeroU64::new(sending_id.get() + 1);
        Ok(())
    }
/// Send a confirmed message to the other connector. The connector will try to make sure this message arrives. It is not guaranteed that messages will arrive in the same order at the other side.
Send a confirmed message to the other connector. The connector will try to make sure this message arrives. It is not guaranteed that messages will arrive in the same order at the other side.
Send a confirmed message to the other connector . The connector will try to make sure this message arrives . It is not guaranteed that messages will arrive in the same order at the other side .
pub fn send_confirmed<T: Into<TParam::TSend>>(
        &mut self,
        socket: &mut dyn Socket,
        msg: T,
    ) -> Result<()> {
        let sending_id = if let Some(id) = self.send.next_message_id {
            id
        } else {
            unsafe { NonZeroU64::new_unchecked(1) }
        };
        let data = Packet::Data {
            data: msg.into(),
            message_id: Some(sending_id),
        };
        send_packet_to(self.peer_addr, socket, &data)?;
        self.send.unconfirmed_message_cache.insert(
            sending_id,
            CachedPacket {
                packet: data,
                last_emit: Instant::now(),
            },
        );
        self.send.next_message_id = NonZeroU64::new(sending_id.get() + 1);
        Ok(())
    }
pub fn send_confirmed < T : Into < TParam :: TSend > > ( & mut self , socket : & mut dyn Socket , msg : T , ) -> Result < ( ) > { let sending_id = if let Some ( id ) = self . send . next_message_id { id } else { unsafe { NonZeroU64 :: new_unchecked ( 1 ) } } ; let data = Packet :: Data { data : msg . into ( ) , message_id : Some ( sending_id ) , } ; send_packet_to ( self . peer_addr , socket , & data ) ? ; self . send . unconfirmed_message_cache . insert ( sending_id , CachedPacket { packet : data , last_emit : Instant :: now ( ) , } , ) ; self . send . next_message_id = NonZeroU64 :: new ( sending_id . get ( ) + 1 ) ; Ok ( ( ) ) }
Send a confirmed message to the other connector.
Send a confirmed message to the other connector .
&mut self
socket
&mut dyn Socket
msg
T
&mut self
socket
&mut dyn Socket
msg
T