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

后端 未结 2 331
醉话见心
醉话见心 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:32

    Have you tried calling SetSockOption with TCP_NODELAY?

    • http://docs.oracle.com/javase/6/docs/api/java/net/SocketOptions.html

    • http://www.ibm.com/developerworks/linux/library/l-hisock/index.html

    • http://en.wikipedia.org/wiki/Nagle%27s_algorithm

提交回复
热议问题