Changeset 233


Ignore:
Timestamp:
Nov 12, 2007, 12:09:45 AM (11 years ago)
Author:
ecprice
Message:

Actually close the connection on disconnect, fixing #3.

Location:
trunk/vnc/vnc_javasrc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/vnc/vnc_javasrc/RfbProto.java

    r66 r233  
    209209
    210210    if (viewer.socketFactory == null) {
     211        System.out.println("Null socketFactory");
    211212      sock = new Socket(host, port);
    212213    } else {
     
    214215        Class factoryClass = Class.forName(viewer.socketFactory);
    215216        SocketFactory factory = (SocketFactory)factoryClass.newInstance();
     217        System.out.println("Using socketFactory " + factory);
    216218        if (viewer.inAnApplet)
    217219          sock = factory.createSocket(host, port, viewer);
     
    237239      sock.close();
    238240      closed = true;
    239       System.out.println("RFB socket closed");
     241      System.out.println("RFB socket closed " + sock);
    240242      if (rec != null) {
    241243        rec.close();
  • trunk/vnc/vnc_javasrc/SocketWrapper.java

    • Property svn:keywords set to Rev
    r143 r233  
    3838        super(new WrappingSocketImpl(delegate));
    3939        this.delegate = delegate;
     40        System.out.println("Creating SocketWrapper $Rev$");
    4041    }
    4142
     
    137138
    138139        protected void close() throws IOException {
     140            System.out.println("Calling delegate.close");
    139141            delegate.close();
    140142        }
     
    241243    }
    242244
     245    public void close() throws IOException {
     246        System.out.println("Calling SocketWrapper.delegate.close");
     247        delegate.close();
     248    }
     249
    243250    public boolean equals(Object obj) {
    244251        if (!(obj instanceof SocketWrapper)) return false;
     
    250257        return delegate.hashCode() ^ 0x01010101;
    251258    }
     259    public String toString() {
     260        return "<SocketWrapper " + super.toString() + "(delegating to " + delegate.toString() +  ")" + ">";
     261    }
    252262}
Note: See TracChangeset for help on using the changeset viewer.