1 public class ServerSocket {
2 /* Socket pending flag */
3 external flag SocketPending;
7 private native int createSocket(int port);
9 public ServerSocket(int port) {
10 this.fd=createSocket(port);
13 public Socket accept() {
14 Socket s=new Socket();
15 int newfd=nativeaccept(s);
20 /* Lets caller pass in their own Socket object. */
21 public void accept(Socket s) {
22 int newfd=nativeaccept(s);
26 private native int nativeaccept(Socket s);