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
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
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