+ Reply to Thread
Results 1 to 2 of 2

Thread: Server Socket Question

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    13

    Server Socket Question

    I have the declaration :
    Code:
    public ServerSocket(int port,int backlog)throws IOException
    Code:
    Where backlog is identified as the maximum queue length for incoming connection. If a connection indication arrives when the queue is full, the connection is refused.
    If backlog is set to 15
    Does that mean that ServerSocket will not accept more than 15 successful connections at a time?
    As Mentioned :
    Code:
        while (serverShouldStillBeRunning) {
            Socket sock = clientSocket.accept();
            js.new Worker(sock).start();
        }

  2. #2
    Junior Member
    Join Date
    Feb 2012
    Posts
    19
    backlog represents a queue of connections waiting to be processed.
    When you accept a connection, the connection will be processed, and is no longer in the queue, so the backlog is reduced by one until it is 0
    Then it will not accept any extra connection until one of the being processed connection is done being processed.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts