]> git.lyx.org Git - lyx.git/blobdiff - src/ServerSocket.cpp
PDF-form.lyx: add a note
[lyx.git] / src / ServerSocket.cpp
index 3d73a67ed6d955c08318323357856f5ec10aa8f9..3535ee4560a94c309ebed3ab80ff58a41f72d9c3 100644 (file)
@@ -97,6 +97,11 @@ string const ServerSocket::address() const
 // 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) {
@@ -104,11 +109,6 @@ void ServerSocket::serverCallback()
                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));