pier        01/07/22 15:49:50

  Modified:    catalina/src/share/org/apache/catalina/connector/warp
                        WarpConnector.java
  Log:
  Updating also the WARP connector to bind to the network in initialize().
  
  Revision  Changes    Path
  1.14      +20 -22    
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnector.java
  
  Index: WarpConnector.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnector.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WarpConnector.java        2001/07/22 18:38:05     1.13
  +++ WarpConnector.java        2001/07/22 22:49:50     1.14
  @@ -440,6 +440,22 @@
           if (initialized)
               throw new LifecycleException("Already initialized");
           this.initialized=true;
  +
  +        // Get a hold on a server socket
  +        try {
  +            ServerSocketFactory fact=this.getFactory();
  +            int port=this.getPort();
  +            int accc=this.getAcceptCount();
  +
  +            if (this.getAddress()==null) {
  +                this.server=fact.createSocket(port,accc);
  +            } else {
  +                InetAddress addr=InetAddress.getByName(this.getAddress());
  +                this.server=fact.createSocket(port,accc,addr);
  +            }
  +        } catch (IOException e) {
  +            throw new LifecycleException("Error creating server socket",e);
  +        }
       }
   
       /**
  @@ -448,6 +464,10 @@
       public void start() throws LifecycleException {
           if (started) throw new LifecycleException("Already started");
   
  +        // Can't get a hold of a server socket
  +        if (this.server==null)
  +            throw new LifecycleException("Server socket not created");
  +
           lifecycle.fireLifecycleEvent(START_EVENT, null);
   
           this.started = true;
  @@ -527,28 +547,6 @@
        * Start accepting WARP requests from the network.
        */
       public void run() {
  -        // Get a hold on a server socket
  -        try {
  -            ServerSocketFactory fact=this.getFactory();
  -            int port=this.getPort();
  -            int accc=this.getAcceptCount();
  -
  -            if (this.getAddress()==null) {
  -                this.server=fact.createSocket(port,accc);
  -            } else {
  -                InetAddress addr=InetAddress.getByName(this.getAddress());
  -                this.server=fact.createSocket(port,accc,addr);
  -            }
  -        } catch (IOException e) {
  -            logger.log("Error creating server socket",e);
  -        }
  -
  -        // Can't get a hold of a server socket
  -        if (this.server==null) {
  -            logger.log("Unable to create server socket");
  -            return;
  -        }
  -
           // Start accepting connections
           try {
               while (this.isStarted()) {
  
  
  

Reply via email to