Wednesday, 20 September 2023
  2 Replies
  824 Visits
  Subscribe
How to iterate TsgcWebSocketServer active connections? Using C++Builder 11.3.

I'm familiar with doing so in Indy, but haven't found a way to do so.
1 year ago
·
#1702
Hello,

It's the same that with Indy. First Lock the connection list, iterate and the unlock the list. Find below an example for CBuilder


TList* oList;
oList = sgcWebSocketServer1->LockList();
try
{
for (int i = 0; i < oList->Count; i++)
{
TIdContext* Context = static_cast<TIdContext*>(oList->Items[i]);
TsgcWSConnection* Connection = static_cast<TsgcWSConnection*>(Context->Data);
}
}
__finally
{
sgcWebSocketServer1->UnLockList();
}


Kind Regards,
Sergio
1 year ago
·
#1704
Thanks for the prompt response!
  • Page :
  • 1
There are no replies made for this post yet.
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below.
Supported: gif,jpg,png,jpeg,zip,rar,pdf,pas,dfm,dpr,dproj,dpk
· Insert · Remove
  Upload Files (Maximum 10MB)