start of new file
[IRC.git] / Robust / src / ClassLibrary / ServerSocket.java
index d99ff83e342900315ae8687a0cb383e8b32b4de6..465ad340989acd133f05bef642b3976eb00b86ac 100644 (file)
@@ -17,6 +17,19 @@ public class ServerSocket {
        return s;
     }
 
+    public Socket accept(tag td) {
+       Socket s=new Socket(){}{td};
+       int newfd=nativeaccept(s);
+       s.setFD(newfd);
+       return s;
+    }
+
+    /* Lets caller pass in their own Socket object. */
+    public void accept(Socket s) {
+       int newfd=nativeaccept(s);
+       s.setFD(newfd);
+    }
+
     private native int nativeaccept(Socket s);
     
     public void close();