I set a tcp connection time out to 1000 microseconds
tv.tv_sec = 0 ;
tv.tv_usec = 1000 ;
setsockopt( sockout, SOL_SOCKET, SO_SNDTIMEO, (char*)&tv, sizeof(tv));
then I sent a buffer with size 1MBytes to network, actually the data size of sent data was only 66562 bytes.
so I increase the timeout period to 50 milliseconds, it works well. bug fixed.