You need to be logged in to view a user's profile.
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.
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
Thanks for the prompt response!
There are no replies made for this post yet.