In article <e9**********************************@q78g2000hsh. googlegroups.com>,
Knight <kn********@yahoo.comwrote:
>On Mar 14, 7:48=A0am, deimoss <marek.jary...@gmail.comwrote:
>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