socket (tcp) buffer status

D

deimoss

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
 
K

Knight

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?
 
W

Walter Roberson

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,187
Members
46,730
Latest member
AudryNolan

Latest Threads

Top