ausrasul 0 Newbie Poster

Hi,
I've wrote two applications in C++ using TCP sockets (winsock).
my compiler is Mingw (Dev-cpp).
using windows XP SP2.

application A send four packets, 5 bytes length each.
application B supposed to receive those packets one by one whenever it has time.

the problem is that when B have time to receive the packets, it receives them all in one Receive() call. and this is what I don't want.

now I have two choices:
1- you help me work around this so B can receive one packet per Receive() call even if the sent packets were stacked in the buffer.
2- let B send a confirmation after each packet, and A will not send until it receives this confirmation, but that will cost bandwidth and CPU time and user's time.


what do you think? did I do something wrong?

P.S. the sender and receiver calls on A and B are running from threads. I'm using multi threads in this application.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.