async fn add_listener(&self) -> Result<(), Error> {
        extern "C" fn listen_cb(arg: *mut c_void, status: i32) {
            let s = unsafe { Box::from_raw(arg as *mut oneshot::Sender<i32>) };
            s.send(status).unwrap();
        }

        let cfg = Config::get();

        // dont yet enable both ports, IOW just add one transportID now

        let trid_replica = TransportID::new(cfg.nexus_opts.nvmf_replica_port);

        let (s, r) = oneshot::channel::<i32>();
        unsafe {
            spdk_nvmf_subsystem_add_listener(
                self.0.as_ptr(),
                trid_replica.as_ptr(),
                Some(listen_cb),
                cb_arg(s),
            );
        }

        r.await.expect("listener callback gone").to_result(|e| {
            Error::Transport {
                source: Errno::from_i32(e),
                msg: "Failed to add listener".to_string(),
            }
        })
    }
// we currently allow all listeners to the subsystem
we currently allow all listeners to the subsystem
we currently allow all listeners to the subsystem
async fn add_listener(&self) -> Result<(), Error> {
        extern "C" fn listen_cb(arg: *mut c_void, status: i32) {
            let s = unsafe { Box::from_raw(arg as *mut oneshot::Sender<i32>) };
            s.send(status).unwrap();
        }
        let cfg = Config::get();
        // dont yet enable both ports, IOW just add one transportID now
        let trid_replica = TransportID::new(cfg.nexus_opts.nvmf_replica_port);
        let (s, r) = oneshot::channel::<i32>();
        unsafe {
            spdk_nvmf_subsystem_add_listener(
                self.0.as_ptr(),
                trid_replica.as_ptr(),
                Some(listen_cb),
                cb_arg(s),
            );
        }
        r.await.expect("listener callback gone").to_result(|e| {
            Error::Transport {
                source: Errno::from_i32(e),
                msg: "Failed to add listener".to_string(),
            }
        })
    }
async fn add_listener ( & self ) -> Result < ( ) , Error > { extern " " fn listen_cb ( arg : * mut c_void , status : i32 ) { let s = unsafe { Box :: from_raw ( arg as * mut oneshot :: Sender < i32 > ) } ; s . send ( status ) . unwrap ( ) ; } let cfg = Config :: get ( ) ; // dont yet enable both ports, IOW just add one transportID now let trid_replica = TransportID :: new ( cfg . nexus_opts . nvmf_replica_port ) ; let ( s , r ) = oneshot :: channel :: < i32 > ( ) ; unsafe { spdk_nvmf_subsystem_add_listener ( self . 0 . as_ptr ( ) , trid_replica . as_ptr ( ) , Some ( listen_cb ) , cb_arg ( s ) , ) ; } r . await . expect ( " " ) . to_result ( | e | { Error :: Transport { source : Errno :: from_i32 ( e ) , msg : " " . to_string ( ) , } } ) }
we currently allow all listeners to the subsystem
we currently allow all listeners to the subsystem
&self