/[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.6 by mkoch, Sat Nov 16 15:48:26 2002 UTC revision 1.7 by mkoch, Mon Nov 18 11:26:03 2002 UTC
# Line 80  public class SocketChannelImpl extends S Line 80  public class SocketChannelImpl extends S
80    public SocketChannelImpl(SelectorProvider provider)                    public SocketChannelImpl(SelectorProvider provider)                
81    {    {
82      super(provider);      super(provider);
   
83      fd = SocketCreate();      fd = SocketCreate();
84                    
85      if (fd == -1)      if (fd == -1)
# Line 138  public class SocketChannelImpl extends S Line 137  public class SocketChannelImpl extends S
137              }              }
138    
139      local_port = err;      local_port = err;
           
140      connected = true;      connected = true;
           
141      return blocking;      return blocking;
142    }    }
143            
# Line 157  public class SocketChannelImpl extends S Line 154  public class SocketChannelImpl extends S
154    public boolean isConnectionPending()    public boolean isConnectionPending()
155    {    {
156      if (blocking)      if (blocking)
157              return false;              return true;
158    
159      return false;      return false;
160    }    }
# Line 179  public class SocketChannelImpl extends S Line 176  public class SocketChannelImpl extends S
176      byte[]b = new byte[len];      byte[]b = new byte[len];
177                    
178      bytes = SocketRead(fd, b, 0, len);      bytes = SocketRead(fd, b, 0, len);
           
179      dst.put(b, 0, bytes);      dst.put(b, 0, bytes);
180    
181      if (bytes == 0)      if (bytes == 0)
# Line 191  public class SocketChannelImpl extends S Line 187  public class SocketChannelImpl extends S
187      return bytes;      return bytes;
188    }    }
189            
       
190    public long read(ByteBuffer[] dsts, int offset, int length)    public long read(ByteBuffer[] dsts, int offset, int length)
191    {    {
192      long bytes = 0;      long bytes = 0;
# Line 204  public class SocketChannelImpl extends S Line 199  public class SocketChannelImpl extends S
199      return bytes;      return bytes;
200    }    }
201            
           
202    public int write(ByteBuffer src)    public int write(ByteBuffer src)
203    {    {
204      int bytes = 0;      int bytes = 0;
# Line 229  public class SocketChannelImpl extends S Line 223  public class SocketChannelImpl extends S
223    public long write (ByteBuffer[] srcs, int offset, int length)    public long write (ByteBuffer[] srcs, int offset, int length)
224    {    {
225      long bytes = 0;      long bytes = 0;
226    
227      for (int i=offset; i<length; i++)      for (int i=offset; i<length; i++)
228              {              {
229          bytes += write(srcs[i]);          bytes += write(srcs[i]);
230              }              }
231    
232      return bytes;      return bytes;
233    }    }
234  }  }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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