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 8407319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:19:44+00:00 2026-06-09T23:19:44+00:00

Here is the situation: I have 2 machines, A and B. A listens to

  • 0

Here is the situation: I have 2 machines, A and B. A listens to a port p. B creates a socket s1 and connects to p. A accepts the connection in socket s2. For now, A and B can communicate with each other through the socket.

However, if I kill the program in A and then restart this program some time later, B doesn’t know because it hasn’t sent any data to A during this period. Now B begins to write data to A through s1. What will happen next? Why?

Actually I found the write call did not fail but A still didn’t get the data. What’s more, if I put s1 in epoll device, I found the event returned by epoll_wait is EPOLLERR | EPOLLHUP after the call to write. Why?

Unfortunately, under this situation, it seems to lose the data since the `write’ call didn’t fail but A couldn’t get the data. Any solutions?

  • 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. Editorial Team
    Editorial Team
    2026-06-09T23:19:47+00:00Added an answer on June 9, 2026 at 11:19 pm
    1. When you kill a program having established sockets, it will send RST to all other end. so B should receive RST on s1, and all future call on s1 will return error. But some firewall may filter out the RST packet, you can check the RST packet with tcpdump.

    2. If B doesn’t receive the RST packet in step1, when it continues sending other packets (write) to A, A will reply with RST packet, and all future call on B will return error once B receive this RST.

    3. If B doesn’t receive the RST packet in step2 too, after a certain time (write timeout), B will drop the connection, and all future call on B will return error.

    You can see, write call seldom return error, it returns success if the packet is send, doesn’t care whether the remote end receives the packet.

    in your situation, you don’t get EPOLLHUP as soon as you call epoll_wait, but after received RST or write timeout

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

Sidebar

Related Questions

Here's the situation - I have a vb.net exe compiled for X86 machines using
Here is the situation: I have inherited two separate machines, one used for development
Here is the situation : we have to offer a customer with a web-based
Here is my situation: I have one table that contains a list of drugs
here's the situation: I have a where in every cell all the area has
Here is my situation: I have a C project linking with many libraries (I
Here's the situation I have a webpage which has one drop down called prefer.
Here's the situation: I have a two images that are over 1024 in width
Here is the situation: You have one long-running calculation running in a background thread.
I have an situation here that looks very like a SELECT N+1 from the

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.