How to determine the data is sent by socket send function
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I checked the the return value of the send function. It just gave how many byte of data is successful sent. However, the data is not really sent out from the system on this API reply. It just pass the data to lower layer and waiting for send physically. For my question, I want to know whether Linux has API for me to check whether there are data waiting for send in network layer. Sorry to tell that, my application is send data through by socket connection.
For the man page on web, it is really very useful. thank you very much.
By the way, is there any others which will group the APIs by features, eg. network connection and etc.
I was looking through /usr/include/linux/sockios.h for an ioctl that might help, but I didn't see one. Generally receipt is more important than transmission; therefore, you might consider having the receiver send a response and wait for it at the sender before moving on.
ta0kira
Thank you for all of your replies.
Let me talks about more about my application.
Actually, the Linux system is running in an embedded system and it will send data through socket connection only. The system will fall in suspend mode regularly. So when the system woke up and let the application to send data out. After the data is sent in application layer, i.e it has reply from send api already, the system fall in suspend again. Then I found there is data lost due to system slept.
So my question is how I know that the data is really sent out before the system sleep.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.