This commit was manufactured by cvs2svn to create tag 'buildscript'.
[IRC.git] /
1 public class ServerSocket {
2     /* File Descriptor */
3     int fd;
4
5     private native int createSocket(int port);
6
7     public ServerSocket(int port) {
8         this.fd=createSocket(port);
9     }
10     
11     public Socket accept() {
12         Socket s=new Socket();
13         int newfd=nativeaccept(s);
14         s.setFD(newfd);
15         return s;
16     }
17
18     /* Lets caller pass in their own Socket object. */
19     public void accept(Socket s) {
20         int newfd=nativeaccept(s);
21         s.setFD(newfd);
22     }
23
24     private native int nativeaccept(Socket s);
25     
26     public void close();
27
28 }