Changeset 98b1415


Ignore:
Timestamp:
Jul 5, 2011 12:47:19 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
49b3900
Parents:
476caf3
Message:

fix error on HTTP Proxy shutdown

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/InternalSocketRunner.java

    r476caf3 r98b1415  
    1616 */
    1717class InternalSocketRunner implements Runnable {
    18     private I2PTunnelClientBase client;
    19     private int port;
     18    private final I2PTunnelClientBase client;
     19    private final int port;
    2020    private ServerSocket ss;
    21     private boolean open;
    22     private static final Log _log = new Log(InternalSocketRunner.class);
     21    private volatile boolean open;
    2322
    2423    /** starts the runner */
     
    3433            this.ss = new InternalServerSocket(this.port);
    3534            this.open = true;
    36             while (true) {
     35            while (this.open) {
    3736                Socket s = this.ss.accept();
    3837                this.client.manageConnection(s);
     
    4039        } catch (IOException ex) {
    4140            if (this.open) {
    42                 _log.error("Error listening for internal connections on port " + this.port, ex);
     41                Log log = new Log(InternalSocketRunner.class);
     42                log.error("Error listening for internal connections on port " + this.port, ex);
    4343            }
    4444            this.open = false;
     
    4848    void stopRunning() {
    4949        if (this.open) {
     50            this.open = false;
    5051            try {
    5152                this.ss.close();
    5253            } catch (IOException ex) {}
    53             this.open = false;
    5454        }
    5555    }
Note: See TracChangeset for help on using the changeset viewer.