Continuously read objects from an ObjectInputStream in Java

后端 未结 4 1544
时光说笑
时光说笑 2020-12-12 04:48

I have a problem using an ObjectInputStream and I have been struggling with it for 2 days now. I tried to search for a solution but unfortunately found no fitting answer.

4条回答
  •  感动是毒
    2020-12-12 05:12

    Try this and let me know how it goes:

    while (1==1)
    {
        StubConfig = (StubConfiguration)mObjectIn.readObject();
        Thread.sleep(100); //Saves CPU usage
    }
    

提交回复
热议问题