Java: Are concurrent reads and writes possible on a blocking SocketChannel via Object(In|Out)putStreams?

后端 未结 4 867
感情败类
感情败类 2021-02-08 17:28

I created an ObjectInputSteam and ObjectOutputStream on a blocking SocketChannel and am trying to read and write concurrently. My code is

4条回答
  •  旧巷少年郎
    2021-02-08 18:13

    If you want to use InputStream and OutputStream concurrently with SocketChannel, from looking at the source, it appears that you need to call SocketChannel.socket() and use the streams from that which behave slightly differently.

提交回复
热议问题