james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject cvs commit: james-server/src/java/org/apache/james/core AbstractJamesService.java
Date Thu, 13 May 2004 03:06:59 GMT
noel        2004/05/12 20:06:59

  Modified:    src/java/org/apache/james/core Tag: branch_2_1_fcs
                        AbstractJamesService.java
  Log:
  Fix JAMES-283.  Allow connection (server socket) backlog to be configurable)
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.4.4.6   +25 -1     james-server/src/java/org/apache/james/core/AbstractJamesService.java
  
  Index: AbstractJamesService.java
  ===================================================================
  RCS file: /home/cvs/james-server/src/java/org/apache/james/core/AbstractJamesService.java,v
  retrieving revision 1.4.4.5
  retrieving revision 1.4.4.6
  diff -u -r1.4.4.5 -r1.4.4.6
  --- AbstractJamesService.java	15 Mar 2004 03:54:15 -0000	1.4.4.5
  +++ AbstractJamesService.java	13 May 2004 03:06:59 -0000	1.4.4.6
  @@ -59,6 +59,16 @@
       protected static final String TIMEOUT_NAME = "connectiontimeout";
   
       /**
  +     * The default value for the connection backlog.
  +     */
  +    protected static final int DEFAULT_BACKLOG = 5;
  +
  +    /**
  +     * The name of the parameter defining the connection backlog.
  +     */
  +    protected static final String BACKLOG_NAME = "connectionBacklog";
  +
  +    /**
        * The name of the parameter defining the service hello name.
        */
       public static final String HELLO_NAME = "helloName";
  @@ -120,6 +130,11 @@
       protected int timeout;
   
       /**
  +     * The connection backlog.
  +     */
  +    protected int backlog;
  +
  +    /**
        * The hello name for the service.
        */
       protected String helloName;
  @@ -252,6 +267,15 @@
                       .append(timeout);
           getLogger().info(infoBuffer.toString());
   
  +        backlog = conf.getChild(BACKLOG_NAME).getValueAsInteger(DEFAULT_BACKLOG);
  +
  +        infoBuffer =
  +                    new StringBuffer(64)
  +                    .append(getServiceType())
  +                    .append(" connection backlog is: ")
  +                    .append(backlog);
  +        getLogger().info(infoBuffer.toString());
  +
           final String location = "generated:" + getServiceType();
   
           if (connectionManager instanceof JamesConnectionManager) {
  @@ -300,7 +324,7 @@
           }
   
           ServerSocketFactory factory = socketManager.getServerSocketFactory(serverSocketType);
  -        ServerSocket serverSocket = factory.createServerSocket(port, 5, bindTo);
  +        ServerSocket serverSocket = factory.createServerSocket(port, backlog, bindTo);
       
           if (null == connectionName) {
               final StringBuffer sb = new StringBuffer();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message