implement SocketChannel.isConnected

This commit is contained in:
Joel Dice 2009-10-29 16:19:33 -06:00
parent 3c893b2ee3
commit efdfb796d9

View File

@ -42,6 +42,10 @@ public class SocketChannel extends SelectableChannel
return blocking; return blocking;
} }
public boolean isConnected() {
return connected;
}
public Socket socket() { public Socket socket() {
return new Handle(); return new Handle();
} }
@ -59,7 +63,10 @@ public class SocketChannel extends SelectableChannel
} }
public boolean finishConnect() throws IOException { public boolean finishConnect() throws IOException {
return natFinishConnect(socket); if (! connected) {
connected = natFinishConnect(socket);
}
return connected;
} }
public void close() throws IOException { public void close() throws IOException {