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

  • Home
  • SEARCH
  • 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 6223611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:31:13+00:00 2026-05-24T08:31:13+00:00

I write network application which communicates via Linux TCP socket. Recently I’ve noticed send

  • 0

I write network application which communicates via Linux TCP socket. Recently I’ve noticed send system call crashing my application. It works fine when both peers are up (I’m testing crash recovery now). But when one peer is down second crashes executing this piece of code.

    fprintf(stderr, "out_tcp %d\n", out_tcp);
    if(send(out_tcp, &packet, sizeof(packet), 0) == -1) 
        fprintf(stderr, "send TCP error");
    fprintf(stderr, "after send");

Socket is already prepared and connected and was executed several times before second peer went down. I’ve expected this code returning -1 value, but it produces on output only “out_tcp 11” then application exits. No error message, no returned value from send. I run it under Valgrind, it says application exits normally – no error/warning message.

Does anyone has any idea how to debug it? Tools to use? I’m pretty stuck with this as I get no informations.

Thanks in advance
Harnen

  • 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-05-24T08:31:13+00:00Added an answer on May 24, 2026 at 8:31 am

    Looks like your application is ignoring SIGPIPE. Please see this thread for further information:

    How to prevent SIGPIPEs (or handle them properly)

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

Sidebar

Related Questions

I've a small asp.net application which write logs on the file system in a
I'm trying to interact with an application over the network which uses a simple
I have a small application which sends files over the network to an agent
I'm preparing to write a multithread network application. At the moment I'm wondering what's
I have to write an Application which shares data over an Wireless Ad Hoc
I've been trying write an application which will be able to connect to a
I'm working on a network application for my class. Basically I have to write
I use a C++ library in my application which connects to the network (I
I want to write an application which consists on perform actions when a known
I have to write an application, which will compare the modification date of two

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.