/[classpath]/classpath/gnu/java/nio/SocketChannelImpl.java
ViewVC logotype

Diff of /classpath/gnu/java/nio/SocketChannelImpl.java

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

revision 1.23 by tromey, Fri Apr 23 21:13:20 2004 UTC revision 1.24 by mkoch, Sun Nov 21 20:23:33 2004 UTC
# Line 182  public final class SocketChannelImpl ext Line 182  public final class SocketChannelImpl ext
182      // FIXME: Handle blocking/non-blocking mode.      // FIXME: Handle blocking/non-blocking mode.
183    
184      Selector selector = provider().openSelector();      Selector selector = provider().openSelector();
185      register (selector, SelectionKey.OP_CONNECT);      register(selector, SelectionKey.OP_CONNECT);
186    
187      if (isBlocking())      if (isBlocking())
188        {        {
# Line 216  public final class SocketChannelImpl ext Line 216  public final class SocketChannelImpl ext
216      return socket;      return socket;
217    }    }
218    
219    public int read (ByteBuffer dst) throws IOException    public int read(ByteBuffer dst) throws IOException
220    {    {
221      if (!isConnected())      if (!isConnected())
222        throw new NotYetConnectedException();        throw new NotYetConnectedException();
# Line 227  public final class SocketChannelImpl ext Line 227  public final class SocketChannelImpl ext
227      int available = input.available();      int available = input.available();
228      int len = dst.capacity() - dst.position();      int len = dst.capacity() - dst.position();
229                    
230      if (available == 0)      if (! isBlocking() && available == 0)
231        return 0;        return 0;
232            
233      if (len > available)      if (len > available)

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