2 /* Data pending flag */
3 external flag IOPending;
6 private SocketInputStream sin;
9 sin=new SocketInputStream(this);
13 public InputStream getInputStream() {
17 public Socket(String host, int port) {
18 InetAddress address=InetAddress.getByName(host);
19 fd=nativeBind(address.getAddress(), port);
20 nativeConnect(fd, address.getAddress(), port);
23 public Socket(InetAddress address, int port) {
24 fd=nativeBind(address.getAddress(), port);
25 nativeConnect(fd, address.getAddress(), port);
28 public static native int nativeBind(byte[] address, int port);
30 public native int nativeConnect(int fd, byte[] address, int port);
32 int setFD(int filed) {
36 public int read(byte[] b) {
39 public void write(byte[] b) {
43 private native int nativeRead(byte[] b);
44 private native void nativeWrite(byte[] b);
45 private native void nativeClose();