/[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.32 by mkoch, Fri Sep 19 06:12:39 2003 UTC revision 1.33 by mkoch, Fri Sep 19 07:07:40 2003 UTC
# Line 1  Line 1 
1  /* Socket.java -- Client socket implementation  /* Socket.java -- Client socket implementation
2     Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.     Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
35  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
36  exception statement from your version. */  exception statement from your version. */
37    
38    
39  package java.net;  package java.net;
40    
41  import gnu.java.net.PlainSocketImpl;  import gnu.java.net.PlainSocketImpl;
# Line 86  public class Socket Line 87  public class Socket
87    private boolean inputShutdown = false;    private boolean inputShutdown = false;
88    private boolean outputShutdown = false;    private boolean outputShutdown = false;
89    
   SocketChannel ch; // this field must have been set if created by SocketChannel  
   
90    private boolean closed = false;    private boolean closed = false;
91    
92    /**    /**
# Line 297  public class Socket Line 296  public class Socket
296      // that default.  JDK 1.2 doc infers not to do a bind.      // that default.  JDK 1.2 doc infers not to do a bind.
297    }    }
298    
   /*  
    * This method may only be used by java.nio.channels.ServerSocketChannel.accept and  
    * java.nio.channels.SocketChannel.open.  
    */  
   void setChannel (SocketChannel ch)  
   {  
     this.ch = ch;  
   }  
   
299    /**    /**
300     * Binds the socket to the givent local address/port     * Binds the socket to the givent local address/port
301     *     *
# Line 400  public class Socket Line 390  public class Socket
390      if (! (endpoint instanceof InetSocketAddress))      if (! (endpoint instanceof InetSocketAddress))
391        throw new IllegalArgumentException ("Address type not supported");        throw new IllegalArgumentException ("Address type not supported");
392    
393      if (ch != null && !ch.isBlocking ())      if (getChannel() != null
394            && !getChannel().isBlocking ())
395        throw new IllegalBlockingModeException ();        throw new IllegalBlockingModeException ();
396        
397      if (!isBound ())      if (!isBound ())
# Line 881  public class Socket Line 872  public class Socket
872      if (impl != null)      if (impl != null)
873        impl.close();        impl.close();
874    
875      if (ch != null)      if (getChannel() != null)
876        ch.close();        getChannel().close();
877            
878      closed = true;      closed = true;
879    }    }
# Line 969  public class Socket Line 960  public class Socket
960     */     */
961    public SocketChannel getChannel()    public SocketChannel getChannel()
962    {    {
963      return ch;      return null;
964    }    }
965    
966    /**    /**

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

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