using namespace lyx::support;
-
namespace lyx {
// Address is the unix address for the socket.
// is OK and if the number of clients does not exceed MAX_CLIENTS
void ServerSocket::serverCallback()
{
+ if (clients.size() >= MAX_CLIENTS) {
+ writeln("BYE:Too many clients connected");
+ return;
+ }
+
int const client_fd = socktools::accept(fd_);
if (fd_ == -1) {
return;
}
- if (clients.size() >= MAX_CLIENTS) {
- writeln("BYE:Too many clients connected");
- return;
- }
-
// Register the new client.
clients[client_fd] =
shared_ptr<LyXDataSocket>(new LyXDataSocket(client_fd));