Problem with sending bytes from client to server using TCP?

You have to initialize offset with zero. Otherwise it could be any random value. You do not need Sleep as send call is blocking.

Buffer that you are sending could be split. So if you send, for example, 2K buffer, you could get it in two parts - 1.5K and 0.5K, so you have to perform multiple reads on a client side. MTU is usually set to 1500 bytes.

Stupid me,i missed that. Now it sends correctly. – vBx Feb 27 '11 at 22:56 @vBx, you should compile with warnings, such as -Wuninitialized (GCC).

– Matthew Flaschen Feb 27 '11 at 23:07 thank for the good advice – vBx Feb 27 '11 at 23:25.

Actually I didnt,that was my problem,i don;t know how I missed that – vBx Feb 27 '11 at 22:56.

Example code, but you never actually initialize offset. It might have any value, e.g. -5000 and will cause the loop to send 5669 bytes.

The uninitialization variable was the problem,your right – vBx Feb 27 '11 at 22:57.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions