Writing messages to client socket using DataOutputStream to Server Socket only sent after closing the Client Socket why?

后端 未结 2 335
醉话见心
醉话见心 2021-01-21 11:04

I had a Socket-Client programming in Java . I am using DataOutputStream to send messages to the Server Socket . Sometimes writed messages on DataOutputstream was not sent to the

2条回答
  •  不知归路
    2021-01-21 11:24

    You have posted too much code, but 99 times out of 100 in these cases where you only see the data after the stream / program has closed your problem is that you are never flushing the data after it is written

提交回复
热议问题