I encounted a simlar problem like following problem (Unfortunately,
there was no answer...)
http://groups.google.com/group/comp....ad745605f2b5ac
Thoguth I myself found the solution, I could not understand it. So I
post this.
The problem is as followings,
* Windows client
step1. socket is crated with SOCK_STREAM, IPPROTO_TCP options
step2. connect()
step3. open a file which size is about 150kb
step4. send piece (255byte) of file in while loop (with 200 ms sleep)
* Linux server
step1. both listen and accept socket is created with SOCK_STREAM, 0
options
step2. bind, listen, accept (when window client connect)
step3. create file and write received piece of file from windows
client
* Result
Windows client rightly connected to linux server and began to send
piece of file to linux server.
But after sending 42075 byte, both client and server were blocked. -
_-;;
With same source code of both server and client, in case of window-
window, the file is successfuly transferred.
* Soluction
After windows client connect to linux server, I set SO_RCVBUF to
client socket (not SO_SNDBUF) as followings,
int tmp = 819200;
m_pChildSock->set_sockopt(SOL_SOCKET, SO_RCVBUF, (char*)&tmp,
sizeof(tmp));
As result, window client could successfuly send the file to linux
server.
¡Ø I tried to set SO_SNDBUF to socket, and after before window client
connect to linux server, change send/receive buff size of linux
server. and chang the sleep interval of client.
All of above try were failed.
And the size of received buff should bigger than the size of file to
send.
Why after set receive buff size to client socket, the transfer
succeed???