Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 53981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:08:54+00:00 2026-05-10T17:08:54+00:00

How does TCP/IP report errors when packet delivery fails permanently? All Socket.write() APIs I’ve

  • 0

How does TCP/IP report errors when packet delivery fails permanently? All Socket.write() APIs I’ve seen simply pass bytes to the underlying TCP/IP output buffer and transfer the data asynchronously. How then is TCP/IP supposed to notify the developer if packet delivery fails permanently (i.e. the destination host is no longer reachable)?

Any protocol that requires the sender to wait for confirmation from the remote end will get an error message. But what happens for protocols where a sender doesn’t have to read any bytes from the destination? Does TCP/IP just fail silently? Perhaps Socket.close() will return an error? Does the TCP/IP specification say anything about this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:08:55+00:00Added an answer on May 10, 2026 at 5:08 pm

    TCP/IP is a reliable byte stream protocol. All your bytes will get to the receiver or you’ll get an error indication.

    The error indication will come in the form of a closed socket. Regardless of what the communication pattern (who does the sending), if the bytes can’t be delivered, the socket will close.

    So the question is, how do you see the socket close? If you’re never reading, you’d eventually get an error trying to write to the closed socket (with ECONNRESET errno, I think).

    If you have a need to sleep or wait for input on another file handle, you might want to do your waiting in a select() call where you include the socket in the list of sources you’re waiting on (even if you never expect to receive anything). If the select() indicates that the socket is ready for a read call, you may get a -1 return (with ECONNRESET, I think). An EOF would indicate an orderly close (other side did a shutdown() or close().

    How to distinguish this error close from a clean close (other program exiting, for example)? The errno values may be enough to distinguish error from orderly close.

    If you want an unambiguous indication of a problem, you’ll probably need to build some sort of application level protocol above the socket layer. For example, a short ‘ack’ message sent by the receiver back to the sender. Then the violation of that higher level application protocol (sender didn’t see an ack) would be a confirmation that it was an error close vs a clean close.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 118k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Simply remove the control from its parent, and then add… May 11, 2026 at 11:36 pm
  • Editorial Team
    Editorial Team added an answer Can't you use the technique described here: C# - How… May 11, 2026 at 11:36 pm
  • Editorial Team
    Editorial Team added an answer Please read: All Abstractions Are Failed Abstractions It should put… May 11, 2026 at 11:36 pm

Related Questions

How does TCP/IP report errors when packet delivery fails permanently? All Socket.write() APIs I've
The socket API is the de-facto standard for TCP/IP and UDP/IP communications (that is,
Greetings. I'm just getting started with the boost::asio library and have run into some
How can I force my ASP.Net application to connect to a SQL Server using
I know the word connection isn't really appropriate when talking about UDP, but... How

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.