Blocking vs non-blocking mode

From: Puzzolino (puzzolino77_at_libero.it)
Date: 02/10/05


Date: Thu, 10 Feb 2005 13:46:09 GMT

I've been using mainly blocking TCP sockets until now, with a thread
handling blocking sends/recvs. Now that I try non-blocking sockets, I've
found a problem, which turns out to be an interesting "feature" in the
blocking model.

If client A sends data throught his DSL connection to client B which still
uses a slow 56K internet connection, the traffic is somewhat "compensated"
in blocking mode; that is, client A will slow down automatically to match
client B speed.

In non-blocking mode, client A sends all data immediately as soon as he can,
no matter client B is able to get data in time; this results in data loss in
some cases.

Did anyone experience or find a solution to this problem?



Relevant Pages

  • Re: Trend CS Suite or CSM Suite for SMB?
    ... ScanMail / Exchange-aware A/V). ... before they even get to user's mailboxes, ... blocking & spam filtering. ... > I have a client who will be installing SMB 2k3 Prem but will not be ...
    (microsoft.public.windows.server.sbs)
  • Re: Threading question
    ... to the client, which thread will process the data, the caller or the client ... *If i have a threadpool that call a method on the client (via an interface), ... You will have blocking on some level if you are waiting for something, ... thread make a blocking call, and then when the call returns, you can notify ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Non-blocking method for reading writing objects to sockets
    ... also am writing a client/server using non blocking io. ... However I have set up a selector to select those clients with buffers ready to be read. ... When a client connects, register the channel with a reading selector ...
    (comp.lang.java.programmer)
  • Having a problem with some socket code
    ... Anyway I have it working with threads, as each client connects the socket ... data method that calls recieve directly to get the size of the data in the ... This all works great if I don't use the Poll method to prevent the blocking ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Sockets in C on Linux
    ... has (for some reason) stopped reading/writing the socket. ... use either alarm() (looks relatively simple but isn't ... really) or select/polland non-blocking sockets ). ... using alarmand blocking calls, ...
    (comp.programming)