Re: synchronization control between the socket sender and socket recei



A potential solution for the issue of sender sending faster than
receiver receiving is to use an acknowledgement scheme. Example in
pseudo-code:

Client Application:

while(notFinishedSending){
msg = CreateMessage("Can I send 10 packets over?")
Send(msg)
Receive(response)
if(response == yes){ Send(10 packets of data) }
else{ wait(1 second)}
}

obviously this solution requires a bit more coding invovled, the second
question I am unable to understand it, can you please rephrase?

Vic wrote:
I have several files from the server side, and they need to be sent to the
client side in parallel. (Working on PC, VC6 suing ws2_32.lib)
After the client received the data, different consumers use the data in
parallel.
We plan to use socket (TCP) to transform the data through one single port,
and the server side send the data from different files one by one.
For example, we have file 1, 2, 3, then the server send socket of data from
the files in sequence, like: 1, 2, 3, 1, 2, 3, 1, 2, 3.....
Sender's speed is faster than receiver's speed. Some files maybe consumed
faster than other files.
The problem is how to control the synchronization between the sender and
receiver?
If we do not control the synchronization, when more data arrive then can be
consumed, data will be lost.

If at the receiver side, do not request the socket of data until it is used,
or we have enough space to save the data,
then the socket will be blocked by the slowest consumer.

Could you please tell me the best way to solve this problem? Your helpful
suggestions are highly appreciated!

Thanks!

Victor

.



Relevant Pages

  • Re: detect bytes written on abort
    ... to implement a protocol where the sender and receiver always agree ... I only want to be able to track how many bytes were sent to the client, which equals the value that is eventually written to the server log file. ... If a failure prevents reliable delivery, the sender is informed.", Internetworking with TCP/IP Vol. ... When a writeon a socket returns, ...
    (comp.lang.php)
  • Re: detect bytes written on abort
    ... makes it unreliable, as a successful fwrite() on a socket may simply mean that the data has been placed in a buffer on the sender, not even passed to the OS yet. ... You don't know that the other end of the TCP connection is on the user's browser. ... to implement a protocol where the sender and receiver always agree ... I only want to be able to track how many bytes were sent to the client, which equals the value that is eventually written to the server log file. ...
    (comp.lang.php)
  • Re: UDP packets loss
    ... I am running a client/server test app over IPOIB in which the client sends ... server prints the bandwidth and how much data it received. ... Maybe the kernel is not designed to handle packets ... There clearly is an upper bound on the packet rate any given receiver can handle, ...
    (Linux-Kernel)
  • Re: UDP packets loss
    ... I am running a client/server test app over IPOIB in which the client ... If receiver application can't keep up UDP drops packets. ... Don't expect flow control or reliable delivery; ...
    (Linux-Kernel)
  • Re: Return receipt for Win2003 server Fax
    ... > I have just setup Windows 2003 on the network. ... > installed on both the server and the client. ... > to say the receiver ...
    (microsoft.public.win2000.fax)