1 public class ServerSocket {
5 private native int createSocket(int port);
7 public ServerSocket(int port) {
8 this.fd=createSocket(port);
11 public Socket accept() {
12 Socket s=new Socket();
13 int newfd=nativeaccept(s);
18 /* Lets caller pass in their own Socket object. */
19 public void accept(Socket s) {
20 int newfd=nativeaccept(s);
24 private native int nativeaccept(Socket s);