/[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.1 by rveldema, Mon Mar 11 16:24:12 2002 UTC revision 1.2 by rveldema, Tue Mar 12 11:36:22 2002 UTC
# Line 1  Line 1 
1  package manta.runtime;  package gnu.java.nio;
2    
3  import java.net.*;  import java.net.*;
4  import java.io.*;  import java.io.*;
# Line 24  public class SocketChannelImpl extends S Line 24  public class SocketChannelImpl extends S
24      static native int SocketRead(int fd, byte b[], int off, int len);      static native int SocketRead(int fd, byte b[], int off, int len);
25      static native int SocketWrite(int fd, byte b[], int off, int len);      static native int SocketWrite(int fd, byte b[], int off, int len);
26    
27        public SocketChannelImpl(SelectorProvider provider)              
     SocketChannelImpl(SelectorProvider provider)                        
28      {      {
29          super(provider);          super(provider);
30    
# Line 45  public class SocketChannelImpl extends S Line 44  public class SocketChannelImpl extends S
44              }              }
45      }      }
46    
47        public int validOps()
     int validOps()  
48      {      {
49          return SelectionKey.OP_READ | SelectionKey.OP_WRITE | SelectionKey.OP_CONNECT;          return SelectionKey.OP_READ | SelectionKey.OP_WRITE | SelectionKey.OP_CONNECT;
50      }      }
# Line 64  public class SocketChannelImpl extends S Line 62  public class SocketChannelImpl extends S
62              return;              return;
63      }        }  
64    
65      boolean connect(SocketAddress  remote)      public boolean connect(SocketAddress  remote)
66          throws IOException          throws IOException
67      {      {
68          if (connected)          if (connected)
# Line 95  public class SocketChannelImpl extends S Line 93  public class SocketChannelImpl extends S
93          return blocking;          return blocking;
94      }      }
95            
96      boolean finishConnect()      public boolean finishConnect()
97      {      {
98          return false;          return false;
99      }      }
100    
101      boolean isConnected()      public boolean isConnected()
102      {      {
103          return connected;          return connected;
104      }      }
105            
106      boolean isConnectionPending()      public boolean isConnectionPending()
107      {      {
108          if (blocking)          if (blocking)
109              return false;              return false;
110          return false;          return false;
111      }      }
112      Socket socket()      
113        public Socket socket()
114      {      {
115          if (sock_object != null)          if (sock_object != null)
116              {              {
117                  sock_object.ch = this;                  //sock_object.ch = this;
118              }              }
119          return sock_object;          return sock_object;
120      }      }
121    
122    
123      int read(ByteBuffer  dst)      public int read(ByteBuffer  dst)
124      {      {
125          int bytes = 0;          int bytes = 0;
126                    
# Line 143  public class SocketChannelImpl extends S Line 142  public class SocketChannelImpl extends S
142      }      }
143            
144            
145      long read(ByteBuffer[]  dsts, int  offset, int  length)      public long read(ByteBuffer[]  dsts, int  offset, int  length)
146      {      {
147          long bytes = 0;          long bytes = 0;
148          for (int i=offset; i<length; i++)          for (int i=offset; i<length; i++)
# Line 154  public class SocketChannelImpl extends S Line 153  public class SocketChannelImpl extends S
153      }      }
154            
155                    
156      int write(ByteBuffer  src)      public int write(ByteBuffer  src)
157      {      {
158          int bytes = 0;          int bytes = 0;
159                    
# Line 182  public class SocketChannelImpl extends S Line 181  public class SocketChannelImpl extends S
181          return bytes;          return bytes;
182      }      }
183    
184      long write(ByteBuffer[]  srcs, int  offset, int  length)      public long write(ByteBuffer[]  srcs, int  offset, int  length)
185      {      {
186          long bytes = 0;          long bytes = 0;
187          for (int i=offset; i<length; i++)          for (int i=offset; i<length; i++)

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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