recv function of Sockets :/

09/21/2012 19:43 ernilos#1
Hi huys! I have a big error in my program. When i received the packets, don't apear all packet, only shows one part (little) and chang's on every packet D:
Code:
char recvbuf[256];
recv(sConnect, recvbuf, 256, 0);
			string login_packet = DecryptLoginPacket(recvbuf).c_str();
			cout << " Packet Received Lenght: " << login_packet.length() << endl;
			cout << login_packet.c_str() << endl;
Image:
[Only registered and activated users can see links. Click Here To Register...]
09/24/2012 13:46 Mi4uric3#2
"recv()" returns the length of the packet, maybe you should use it in any way..?

Like:
Code:
int pLength = recv(...)
Don't know if this is important, because your packet seems to be a string (at least you use "c_str()"..)
09/24/2012 17:08 .SkyneT.#3
Code:
DecryptLoginPacket(recvbuf).c_str();
Seems wrong to me

Sure that is isn't something like:
Code:
DecryptLoginPacket(recvbuf.c_str());
(Dont know the prototype so i can just guess what's wrong)

Is the packet complete in recvbuf ?
If not, check the DecryptLoginPacket function.