473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

socket (tcp) buffer status

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
Mar 14 '08 #1
2 3267
On Mar 14, 7:48*am, 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?

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?
Mar 14 '08 #2
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
Mar 20 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert A. van Ginkel | last post by:
In news:OZ0W9RsdDHA.2432@TK2MSFTNGP10.phx.gbl... I ask the question how I can see if all the data is on the other side of the connection. I got as answer that I should use the blocking property. I...
4
by: Brian Rice | last post by:
I have a socket application that is sending and receiving packets asynchronously. It works great except, when I receive packets that are larger than my receive buffer which then generate several...
4
by: Chris Tanger | last post by:
Context: C# System.Net.Sockets Socket created with constructor prarmeters Internetwork, Stream and TCP everything else is left at the default parameters and options except linger may be changed...
13
by: coloradowebdev | last post by:
i am working on basically a proxy server that handles requests via remoting from clients and executes transactions against a third-party server via TCP. the remoting site works like a champ. my...
0
by: Macca | last post by:
Hi, I am writing an asychronous socket server to handle 20+ simulataneous connections. I have used the example in MSDN as a base. The code is shown at end of question. Each connection has a...
4
by: shofu_au | last post by:
Hi Group, A question about threads and asynchronous TCP sockets. In the attached code, even if the host TCP server is not running my code reports that the connection has been established. ...
0
by: george585 | last post by:
Hello! I am new to network programming, and understand just basics. Using some sample code, and having read documentation, I managed to create a simple app in C# and VB.NET. The application is...
2
by: manasap | last post by:
Hi all! I've written a server and a client application using asynchronous sockets.The client sends data packets for every 7 seconds.The server receives the packets. This process proceeds...
1
by: keksy | last post by:
Hi every1, I am writing a small client/server application and in it I want to send an image asynchronous from the client to the server through a TCP socket. I found an example code on the MSDN...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.