pub fn send_without_response(
        &mut self,
        address: NymNodeRoutingAddress,
        packet: SphinxPacket,
        packet_mode: PacketMode,
    ) -> io::Result<()> {
        trace!("Sending packet to {:?}", address);
        let framed_packet = FramedSphinxPacket::new(packet, packet_mode);

        if let Some(sender) = self.conn_new.get_mut(&address) {
            if let Err(err) = sender.channel.try_send(framed_packet) {
                if err.is_full() {
                    debug!("Connection to {} seems to not be able to handle all the traffic - dropping the current packet", address);
                    // it's not a 'big' error, but we did not manage to send the packet
                    // if the queue is full, we can't really do anything but to drop the packet
                    Err(io::Error::new(
                        io::ErrorKind::WouldBlock,
                        "connection queue is full",
                    ))
                } else if err.is_disconnected() {
                    warn!(
                        "Connection to {} seems to be dead. attempting to re-establish it...",
                        address
                    );
                    // it's not a 'big' error, but we did not manage to send the packet, but queue
                    // it up to send it as soon as the connection is re-established
                    self.make_connection(address, err.into_inner());
                    Err(io::Error::new(
                        io::ErrorKind::ConnectionAborted,
                        "reconnection attempt is in progress",
                    ))
                } else {
                    // this can't really happen, but let's safe-guard against it in case something changes in futures library
                    Err(io::Error::new(
                        io::ErrorKind::Other,
                        "unknown connection buffer error",
                    ))
                }
            } else {
                Ok(())
            }
        } else {
            // there was never a connection to begin with
            debug!("establishing initial connection to {}", address);
            // it's not a 'big' error, but we did not manage to send the packet, but queue the packet
            // for sending for as soon as the connection is created
            self.make_connection(address, framed_packet);
            Err(io::Error::new(
                io::ErrorKind::NotConnected,
                "connection is in progress",
            ))
        }
    }
// without response in this context means we will not listen for anything we might get back
// (not that we should get anything), including any possible io errors
without response in this context means we will not listen for anything we might get back
(not that we should get anything), including any possible io errors
without response in this context means we will not listen for anything we might get back ( not that we should get anything ) including any possible io errors
pub fn send_without_response(
        &mut self,
        address: NymNodeRoutingAddress,
        packet: SphinxPacket,
        packet_mode: PacketMode,
    ) -> io::Result<()> {
        trace!("Sending packet to {:?}", address);
        let framed_packet = FramedSphinxPacket::new(packet, packet_mode);
        if let Some(sender) = self.conn_new.get_mut(&address) {
            if let Err(err) = sender.channel.try_send(framed_packet) {
                if err.is_full() {
                    debug!("Connection to {} seems to not be able to handle all the traffic - dropping the current packet", address);
                    // it's not a 'big' error, but we did not manage to send the packet
                    // if the queue is full, we can't really do anything but to drop the packet
                    Err(io::Error::new(
                        io::ErrorKind::WouldBlock,
                        "connection queue is full",
                    ))
                } else if err.is_disconnected() {
                    warn!(
                        "Connection to {} seems to be dead. attempting to re-establish it...",
                        address
                    );
                    // it's not a 'big' error, but we did not manage to send the packet, but queue
                    // it up to send it as soon as the connection is re-established
                    self.make_connection(address, err.into_inner());
                    Err(io::Error::new(
                        io::ErrorKind::ConnectionAborted,
                        "reconnection attempt is in progress",
                    ))
                } else {
                    // this can't really happen, but let's safe-guard against it in case something changes in futures library
                    Err(io::Error::new(
                        io::ErrorKind::Other,
                        "unknown connection buffer error",
                    ))
                }
            } else {
                Ok(())
            }
        } else {
            // there was never a connection to begin with
            debug!("establishing initial connection to {}", address);
            // it's not a 'big' error, but we did not manage to send the packet, but queue the packet
            // for sending for as soon as the connection is created
            self.make_connection(address, framed_packet);
            Err(io::Error::new(
                io::ErrorKind::NotConnected,
                "connection is in progress",
            ))
        }
    }
pub fn send_without_response ( & mut self , address : NymNodeRoutingAddress , packet : SphinxPacket , packet_mode : PacketMode , ) -> io :: Result < ( ) > { trace ! ( " " address ) ; let framed_packet = FramedSphinxPacket :: new ( packet , packet_mode ) ; if let Some ( sender ) = self . conn_new . get_mut ( & address ) { if let Err ( err ) = sender . channel . try_send ( framed_packet ) { if err . is_full ( ) { debug ! ( " " address ) ; // it's not a 'big' error, but we did not manage to send the packet // if the queue is full, we can't really do anything but to drop the packet Err ( io :: Error :: new ( io :: ErrorKind :: WouldBlock , " " , ) ) } else if err . is_disconnected ( ) { warn ! ( " " address ) ; // it's not a 'big' error, but we did not manage to send the packet, but queue // it up to send it as soon as the connection is re-established self . make_connection ( address , err . into_inner ( ) ) ; Err ( io :: Error :: new ( io :: ErrorKind :: ConnectionAborted , " " , ) ) } else { // this can't really happen, but let's safe-guard against it in case something changes in futures library Err ( io :: Error :: new ( io :: ErrorKind :: Other , " " , ) ) } } else { Ok ( ( ) ) } } else { // there was never a connection to begin with debug ! ( " " address ) ; // it's not a 'big' error, but we did not manage to send the packet, but queue the packet // for sending for as soon as the connection is created self . make_connection ( address , framed_packet ) ; Err ( io :: Error :: new ( io :: ErrorKind :: NotConnected , " " , ) ) } }
without response in this context means we will not listen for anything we might get back
(not that we should get anything), including any possible io errors
without response in this context means we will not listen for anything we might get back ( not that we should get anything ) including any possible io errors
&mut self
address
NymNodeRoutingAddress
packet
SphinxPacket
packet_mode
PacketMode
&mut self
address
NymNodeRoutingAddress
packet
SphinxPacket
packet_mode
PacketMode