socket (tcp) buffer status

Discussion in 'C Programming' started by deimoss, Mar 14, 2008.

  1. deimoss

    deimoss Guest

    Hi.
    I write an application that send data using GPRS connection. No data
    can be lost, but I loose some :(. When GSM signal is lost, I get no
    error after writing data to socket. Is that possible to get status of
    the TCP buffer? I'd like to check if the buffer is empty, and if no,
    recover the data to my buffer. How to cope with that?

    Regards,
    deimoss
     
    deimoss, Mar 14, 2008
    #1
    1. Advertising

  2. deimoss

    Knight Guest

    On Mar 14, 7:48 am, deimoss <> wrote:
    > Hi.
    > I write an application that send data using GPRS connection. No data
    > can be lost, but I loose some :(. When GSM signal is lost, I get no
    > error after writing data to socket. Is that possible to get status of
    > the TCP buffer? I'd like to check if the buffer is empty, and if no,
    > recover the data to my buffer. How to cope with that?
    >
    > Regards,
    > deimoss


    Shouldn't TCP at the other endpoint take care of that? It will receive
    a mismatch in TCP segment length and actual segment data and will ask
    your TCP to retransmit. Why do you need to worry about retransmitting
    data from your TCP buffer?
     
    Knight, Mar 14, 2008
    #2
    1. Advertising

  3. [OT] Re: socket (tcp) buffer status

    In article <>,
    Knight <> wrote:
    >On Mar 14, 7:48=A0am, deimoss <> wrote:
    >> Hi.
    >> I write an application that send data using GPRS connection. No data
    >> can be lost, but I loose some :(. When GSM signal is lost, I get no
    >> error after writing data to socket. Is that possible to get status of
    >> the TCP buffer? I'd like to check if the buffer is empty, and if no,
    >> recover the data to my buffer. How to cope with that?


    >Shouldn't TCP at the other endpoint take care of that? It will receive
    >a mismatch in TCP segment length and actual segment data and will ask
    >your TCP to retransmit. Why do you need to worry about retransmitting
    >data from your TCP buffer?


    [OT]
    In some situations, when a connection is lost, it is necessary
    to open a new connection and retransmit from the first byte not
    known to have arrived at the other end. On the other hand, in
    such cases, the application would normally be managing retransmissions
    rather than relying on the TCP stack to manage them. Handling this
    kind of thing by "peeking" at the TCP stack buffers is usually
    messier and more error prone (race conditions) -- and requires deep
    system-dependant knowledge of how the system handles its TCP buffers.

    None of this can be handled by standard C, as C itself does not know
    anything about networking; the OP would need to consult the details
    of the OS.
    --
    "Nothing recedes like success." -- Walter Winchell
     
    Walter Roberson, Mar 20, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tiger
    Replies:
    5
    Views:
    998
    Dave Thompson
    May 1, 2006
  2. Laszlo Nagy
    Replies:
    1
    Views:
    5,007
    Mark Wooding
    Jan 27, 2009
  3. Jean-Paul Calderone
    Replies:
    0
    Views:
    1,012
    Jean-Paul Calderone
    Jan 27, 2009
  4. Laszlo Nagy
    Replies:
    0
    Views:
    582
    Laszlo Nagy
    Feb 1, 2009
  5. John Ramsden
    Replies:
    1
    Views:
    142
    Brian McCauley
    Aug 5, 2003
Loading...

Share This Page