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

Diff of /classpath/java/net/ServerSocket.java

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

revision 1.23 by mkoch, Fri Sep 19 06:12:39 2003 UTC revision 1.24 by mkoch, Fri Sep 19 07:07:40 2003 UTC
# Line 1  Line 1 
1  /* ServerSocket.java -- Class for implementing server side sockets  /* ServerSocket.java -- Class for implementing server side sockets
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 72  public class ServerSocket Line 73  public class ServerSocket
73     */     */
74    private SocketImpl impl;    private SocketImpl impl;
75    
   /**  
    * ServerSocketChannel of this ServerSocket. This channel only exists  
    * when the socket is created by ServerSocketChannel.open().  
    */  
   private ServerSocketChannel ch;  
   
76    private boolean closed = false;    private boolean closed = false;
77        
78    /**    /**
# Line 159  public class ServerSocket Line 154  public class ServerSocket
154      bind (new InetSocketAddress (bindAddr, port), backlog);      bind (new InetSocketAddress (bindAddr, port), backlog);
155    }    }
156    
   /*  
    * This method may only be used by java.nio.channels.ServerSocketChannel.open.  
    */  
   void setChannel (ServerSocketChannel ch)  
   {  
     this.ch = ch;  
   }  
   
157    /**    /**
158     * Binds the server socket to a specified socket address     * Binds the server socket to a specified socket address
159     *     *
# Line 317  public class ServerSocket Line 304  public class ServerSocket
304    protected final void implAccept (Socket s)    protected final void implAccept (Socket s)
305      throws IOException      throws IOException
306    {    {
307      if (ch != null && !ch.isBlocking())      if (getChannel() != null
308            && !getChannel().isBlocking())
309        throw new IllegalBlockingModeException();        throw new IllegalBlockingModeException();
310                            
311      impl.accept(s.impl);      impl.accept(s.impl);
# Line 333  public class ServerSocket Line 321  public class ServerSocket
321      if (impl != null)      if (impl != null)
322        impl.close ();        impl.close ();
323    
324      if (ch != null)      if (getChannel() != null)
325        ch.close ();        getChannel().close ();
326            
327      closed = true;      closed = true;
328    }    }
# Line 350  public class ServerSocket Line 338  public class ServerSocket
338     */     */
339    public ServerSocketChannel getChannel()    public ServerSocketChannel getChannel()
340    {    {
341      return ch;      return null;
342    }    }
343    
344    /**    /**

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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