Michael Barker wrote:
> Attached is a patch to add non-blocking i/o and scatter/gather for nio
> SocketChannels.  I have signed the necessary legal forms for
> contribution.  I have been off for on vaction so its been a 
> little late in coming.

Thanks.

> Please review.

     private int native_fd;
+    private VMChannel vmch = new VMChannel();

Exposing the native_fd as an int in the VM interface is not flexible
enough for some VMs.

A possible solution would be to add the native_fd to VMChannel:

class VMChannel
{
  private int native_fd;

  private VMChannel(int native_fd)
  {
    this.native_fd = native_fd;
  }

  static VMChannel getChannel(PlainSocketImpl socket)
  {
    return new VMChannel(socket.getNativeFd());
  }

  public void setBlocking(boolean blocking)
  {
    setBlocking(native_fd, blocking);
  }

  private static native void setBlocking(int fd, boolean blocking);
}

This allows VM implementers to replace VMChannel if they use a different
mechanism of representing a native resource.

Regards,
Jeroen

Reply via email to