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

后端 未结 4 916
感情败类
感情败类 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:27

    This seems to be a bug in java.nio.channels.Channels (thanks to Tom Hawtin; post it as an answer next time). A good description and workaround are described here (actually a duplicate of the bug Tom listed):

    I tested the workaround and it works.

提交回复
热议问题