Merge branch 'dev' of gitea.larke.org:kevin/libcw into dev
This commit is contained in:
commit
6b2a3db3f0
8
cwIo.cpp
8
cwIo.cpp
@ -2497,7 +2497,7 @@ void cw::io::realTimeReport( handle_t h )
|
||||
{
|
||||
io_t* p = _handleToPtr(h);
|
||||
audio::device::realTimeReport(p->audioH);
|
||||
|
||||
uiRealTimeReport(h);
|
||||
}
|
||||
|
||||
|
||||
@ -3957,8 +3957,8 @@ void cw::io::uiReport( handle_t h )
|
||||
|
||||
void cw::io::uiRealTimeReport( handle_t h )
|
||||
{
|
||||
ui::handle_t uiH;
|
||||
if(_handleToUiHandle(h,uiH) == kOkRC )
|
||||
ui::realTimeReport(uiH);
|
||||
ui::ws::handle_t uiH;
|
||||
if(_handleToWsUiHandle(h,uiH) == kOkRC )
|
||||
ui::ws::realTimeReport(uiH);
|
||||
}
|
||||
|
||||
|
@ -408,6 +408,18 @@ bool cw::nbmpscq::is_empty( handle_t h )
|
||||
return next == nullptr;
|
||||
}
|
||||
|
||||
unsigned cw::nbmpscq::count( handle_t h )
|
||||
{
|
||||
nbmpscq_t* p = _handleToPtr(h);
|
||||
|
||||
block_t* b = p->blockL;
|
||||
int eleN = 0;
|
||||
for(; b!=nullptr; b=b->link)
|
||||
eleN += b->eleN.load(std::memory_order_acquire);
|
||||
|
||||
return eleN;
|
||||
}
|
||||
|
||||
cw::rc_t cw::nbmpscq::test( const object_t* cfg )
|
||||
{
|
||||
rc_t rc=kOkRC,rc0,rc1;
|
||||
|
@ -71,6 +71,8 @@ namespace cw
|
||||
|
||||
bool is_empty( handle_t h );
|
||||
|
||||
unsigned count( handle_t h );
|
||||
|
||||
rc_t test( const object_t* cfg );
|
||||
|
||||
}
|
||||
|
8
cwUi.cpp
8
cwUi.cpp
@ -2216,6 +2216,7 @@ void cw::ui::realTimeReport( handle_t h )
|
||||
{
|
||||
ui_t* p = _handleToPtr(h);
|
||||
printf("UI msg count: recv:%i send:%i\n",p->recvMsgN,p->sentMsgN);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2504,6 +2505,12 @@ cw::ui::handle_t cw::ui::ws::uiHandle( handle_t h )
|
||||
return p->uiH;
|
||||
}
|
||||
|
||||
void cw::ui::ws::realTimeReport( handle_t h )
|
||||
{
|
||||
ui_ws_t* p = _handleToPtr(h);
|
||||
report(p->wsH);
|
||||
realTimeReport(p->uiH);
|
||||
}
|
||||
|
||||
|
||||
namespace cw
|
||||
@ -2674,3 +2681,4 @@ cw::ui::handle_t cw::ui::srv::uiHandle( handle_t h )
|
||||
ui_ws_srv_t* p = _handleToPtr(h);
|
||||
return ws::uiHandle(p->wsUiH);
|
||||
}
|
||||
|
||||
|
3
cwUi.h
3
cwUi.h
@ -236,6 +236,9 @@ namespace cw
|
||||
|
||||
websock::handle_t websockHandle( handle_t h );
|
||||
ui::handle_t uiHandle( handle_t h );
|
||||
|
||||
void realTimeReport( handle_t h );
|
||||
|
||||
}
|
||||
|
||||
namespace srv
|
||||
|
@ -785,3 +785,9 @@ cw::rc_t cw::websock::exec( handle_t h, unsigned timeOutMs )
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
void cw::websock::report( handle_t h )
|
||||
{
|
||||
websock_t* p = _handleToPtr(h);
|
||||
printf("Websock: msgs sent:%i recvd:%i que count:%i\n",p->_sendMsgCnt,p->_recvMsgCnt,count(p->_qH));
|
||||
}
|
||||
|
@ -56,6 +56,8 @@ namespace cw
|
||||
|
||||
// Call periodically from the same thread to send/recv messages.
|
||||
rc_t exec( handle_t h, unsigned timeOutMs );
|
||||
|
||||
void report( handle_t h );
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user