/[classpath]/classpath/java/net/Socket.java
ViewVC logotype

Diff of /classpath/java/net/Socket.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by mkoch, Tue Mar 11 14:35:20 2003 UTC revision 1.26 by rupp, Wed Apr 30 14:10:31 2003 UTC
# Line 291  public class Socket Line 291  public class Socket
291      if (sm != null)      if (sm != null)
292        sm.checkConnect(raddr.getHostName(), rport);        sm.checkConnect(raddr.getHostName(), rport);
293    
294        // create socket
295      impl.create(stream);      impl.create(stream);
296    
297        // bind/connect to address/port
298      // FIXME: JCL p. 1586 says if localPort is unspecified, bind to any port,      // FIXME: JCL p. 1586 says if localPort is unspecified, bind to any port,
299      // i.e. '0' and if localAddr is unspecified, use getLocalAddress() as      // i.e. '0' and if localAddr is unspecified, use getLocalAddress() as
300      // that default.  JDK 1.2 doc infers not to do a bind.      // that default.  JDK 1.2 doc infers not to do a bind.
301      if (laddr != null)      if (laddr != null) {
302        impl.bind(laddr, lport);        try {
303            impl.bind(laddr, lport);
304      if (raddr != null)        } catch (IOException exception) {
305        impl.connect(raddr, rport);          impl.close();
306            throw exception;
307          } catch (RuntimeException exception) {
308            impl.close();
309            throw exception;
310          } catch (Error error) {
311            impl.close();
312            throw error;
313          }
314        }
315        if (raddr != null) {
316          try {
317            impl.connect(raddr, rport);
318          } catch (IOException exception) {
319            impl.close();
320            throw exception;
321          } catch (RuntimeException exception) {
322            impl.close();
323            throw exception;
324          } catch (Error error) {
325            impl.close();
326            throw error;
327          }
328        }
329    }    }
330    
331    /**    /**

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26