Implement socket API

This commit is contained in:
Ilya Mizus
2013-11-05 00:07:43 +03:00
committed by Joshua Warner
parent 2800ffe826
commit 45ee25f68c
10 changed files with 623 additions and 56 deletions

View File

@ -50,7 +50,11 @@ public class SocketChannel extends SelectableChannel
}
public Socket socket() {
return new Handle();
try {
return new Handle();
} catch (IOException e) {
return null;
}
}
public boolean connect(SocketAddress address) throws IOException {
@ -165,7 +169,11 @@ public class SocketChannel extends SelectableChannel
}
public class Handle extends Socket {
public void setTcpNoDelay(boolean on) throws SocketException {
public Handle() throws IOException {
super();
}
public void setTcpNoDelay(boolean on) throws SocketException {
natSetTcpNoDelay(socket, on);
}
}