mirror of
https://github.com/corda/corda.git
synced 2025-06-15 21:58:17 +00:00
implement non-blocking socket connections
This commit is contained in:
@ -58,6 +58,10 @@ public class SocketChannel extends SelectableChannel
|
||||
return connected;
|
||||
}
|
||||
|
||||
public boolean finishConnect() throws IOException {
|
||||
return natFinishConnect(socket);
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
if (isOpen()) {
|
||||
super.close();
|
||||
@ -126,6 +130,8 @@ public class SocketChannel extends SelectableChannel
|
||||
|
||||
private static native int natDoConnect(String host, int port, boolean blocking, boolean[] connected)
|
||||
throws IOException;
|
||||
private static native boolean natFinishConnect(int socket)
|
||||
throws IOException;
|
||||
private static native int natRead(int socket, byte[] buffer, int offset, int length)
|
||||
throws IOException;
|
||||
private static native int natWrite(int socket, byte[] buffer, int offset, int length)
|
||||
|
Reference in New Issue
Block a user