S
sonu
Hi,
I m trying to receive a message on windows sockets using recv()
function.
The message is such that the first two bytes of the message represent
the length of the
message. Hence when trying to recv a message, i m doing 2 recv() calls.
The first recv() call receives the length of the message.
and the second recv() call receives the actual message.
The problem is that the first recv() instead of RECEIVING THE FIRST TWO
BYTES, receives the last two bytes of the message.
e.g unsigned char szTbuf[3];
recv(..., (char * ) szTbuf, 2, 0);
the above receives the last two bytes. and after receving it doesnt
come out.
Can any body help me please.
Sincere Thanx.
rgds,
Sandeep.
I m trying to receive a message on windows sockets using recv()
function.
The message is such that the first two bytes of the message represent
the length of the
message. Hence when trying to recv a message, i m doing 2 recv() calls.
The first recv() call receives the length of the message.
and the second recv() call receives the actual message.
The problem is that the first recv() instead of RECEIVING THE FIRST TWO
BYTES, receives the last two bytes of the message.
e.g unsigned char szTbuf[3];
recv(..., (char * ) szTbuf, 2, 0);
the above receives the last two bytes. and after receving it doesnt
come out.
Can any body help me please.
Sincere Thanx.
rgds,
Sandeep.