1 Reply Latest reply: Apr 8, 2011 12:27 AM by EJP RSS

    Is it possible for a SocketChannel to write and read at the same time ?

    846950
      Hi,

      May a SocketChannel simultaneously read and write ?
        • 1. Re: Is it possible for a SocketChannel to write and read at the same time ?
          EJP
          Yes. TCP/IP is a full-duplex protocol and so is its Java implementation. Both of them.

          The only exception I'm aware of is the odd case where you are using a SocketChannel in blocking mode via the streams from Channels. These are internally synchronized probably on the channel itself or at least some common object, so reads and writes are synchronized against each other. This is clearly a bug.