| 1445 | } |
| 1446 | |
| 1447 | Result HttpWebSocketSmallHub::join(const HttpWebSocketTransportView& transport, size_t& clientIndex) |
| 1448 | { |
| 1449 | SC_TRY_MSG(transport.isValid(), "HttpWebSocketSmallHub transport is invalid"); |
| 1450 | for (size_t idx = 0; idx < clients.sizeInElements(); ++idx) |
| 1451 | { |
| 1452 | HttpWebSocketHubClient& client = clients[idx]; |
| 1453 | if (not client.active) |
| 1454 | { |
| 1455 | client.transport = transport; |
| 1456 | client.active = true; |
| 1457 | clientIndex = idx; |
| 1458 | numClients++; |
| 1459 | return Result(true); |
| 1460 | } |
| 1461 | } |
| 1462 | return Result::Error("HttpWebSocketSmallHub is full"); |
| 1463 | } |
| 1464 | |
| 1465 | Result HttpWebSocketSmallHub::leave(size_t clientIndex) |
| 1466 | { |