private int print_stats() { LBMReceiverStatistics rcv_stats = null; LBMSourceStatistics src_stats = null; string source_type = ""; int nstats = 1; int stat_index = 0; // Get receiver stats try { rcv_stats = _rcv.getStatistics(nstats); } catch (LBMException ex) { System.Console.Error.WriteLine("Error getting receiver statistics: " + ex.Message); return(-1); } if (rcv_stats == null) { System.Console.Error.WriteLine("Cannot print stats, because receiver stats are null"); return(-1); } // Get source stats try { src_stats = _src.getStatistics(); } catch (LBMException ex) { System.Console.Error.WriteLine("Error getting source statistics: " + ex.Message); return(-1); } if (src_stats == null) { System.Console.Error.WriteLine("Cannot print stats, because source stats are null"); return(-1); } // Print transport stats switch (src_stats.type(stat_index)) { case LBM.TRANSPORT_STAT_TCP: break; case LBM.TRANSPORT_STAT_LBTRU: case LBM.TRANSPORT_STAT_LBTRM: if (rcv_stats.lost() != 0 || src_stats.retransmissionsSent() != 0) { source_type = (src_stats.type() == LBM.TRANSPORT_STAT_LBTRM) ? "LBT-RM" : "LBT-RU"; System.Console.Out.WriteLine("The latency for this " + source_type + " session of lbmpong might be skewed by loss"); System.Console.Out.WriteLine("Source loss: " + src_stats.retransmissionsSent() + " " + "Receiver loss: " + rcv_stats.lost()); } break; case LBM.TRANSPORT_STAT_LBTIPC: break; case LBM.TRANSPORT_STAT_LBTSMX: break; case LBM.TRANSPORT_STAT_LBTRDMA: break; } src_stats.dispose(); rcv_stats.dispose(); System.Console.Out.Flush(); return(0); }