2 /* Data pending flag */
3 external flag IOPending;
10 public Socket(String host, int port) {
11 InetAddress address=InetAddress.getByName(host);
12 fd=nativeBind(address.getAddress(), port);
13 nativeConnect(fd, address.getAddress(), port);
16 public Socket(InetAddress address, int port) {
17 fd=nativeBind(address.getAddress(), port);
18 nativeConnect(fd, address.getAddress(), port);
21 public static native int nativeBind(byte[] address, int port);
23 public native int nativeConnect(int fd, byte[] address, int port);
25 int setFD(int filed) {
29 public int read(byte[] b) {
32 public void write(byte[] b) {
36 private native int nativeRead(byte[] b);
37 private native void nativeWrite(byte[] b);
38 private native void nativeClose();