My code is unstable. Sometimes it works, sometimes it doesn't. I guess it depends on network speed or something else.
So please help to improve it. tks a lot.
If run debug, I can see some thing weird:
+ BlockLength always equa 0 after read( newsockfd,&BlockLength, sizeof(int))
+ result is alway equal 1 after read(newsockfd,buffer,BUFF
however, result equal 2048 after fwrite (buffer,1,BUFFER_SEND,fp);
I need your explanation here.
Server crashes because of strncpy().