Re: send() kills the process

From: Barry Margolin (barry.margolin_at_level3.com)
Date: 05/30/03


Date: Fri, 30 May 2003 15:56:07 GMT

In article <81b02cca.0305300712.5b1b14fa@posting.google.com>,
Philippe Hamel <hamelph@hotmail.com> wrote:
>I'm developing a small application to transmit data back and forth
>between AIX and a Windows NT station using TCP/IP sockets.
>
>Weirdly enough, the "server" part of the program resides on the
>Windows and the "client" parts runs on AIX.
>
>If I close the Windows program just before the AIX client expects to
>receive something or during, I'm able to trap it ok on the AIX client,
>retry a couple of time to make sure then log the error and exit. But
>if the Win app closes just before the AIX client sends something, the
>whole AIX app closes immediately. I'm unable to get a return value
>from send.
>
>I'm totally confused on this behavior. I was expecting send to return
>-1 and then be able to get more info from errno.
>
>What could I be doing wrong?

By default, sending to a closed socket results in a SIGPIPE signal. If you
set the handling of this signal to SIG_IGN, the send() call will return an
error as you expect (actually, the error won't be returned until the *next*
send() call, since send() doesn't wait for an acknowledgement).

-- 
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


Relevant Pages

  • Re: How to write files from AIX 4.2.1 to Windows?
    ... AIX box, and Windows users can happily access the AIX box but am ... Try finding a copy of Samba that runs on AIX 4.2 - It lets you copy ... weekday backing up files to tape using the backup command. ...
    (comp.unix.aix)
  • Re: How to write files from AIX 4.2.1 to Windows?
    ... AIX box, and Windows users can happily access the AIX box but am ... any CIFS stuff on my install discs and I'm thinking perhaps it wasn't ... weekday backing up files to tape using the backup command. ...
    (comp.unix.aix)
  • Re: How to write files from AIX 4.2.1 to Windows?
    ... AIX box, and Windows users can happily access the AIX box but am ... any CIFS stuff on my install discs and I'm thinking perhaps it wasn't ... weekday backing up files to tape using the backup command. ...
    (comp.unix.aix)
  • Re: How to write files from AIX 4.2.1 to Windows?
    ... AIX box, and Windows users can happily access the AIX box but am ... any CIFS stuff on my install discs and I'm thinking perhaps it wasn't ... weekday backing up files to tape using the backup command. ...
    (comp.unix.aix)
  • Re: How to write files from AIX 4.2.1 to Windows?
    ... I have samba set up on the ... AIX box, and Windows users can happily access the AIX box but am ... weekday backing up files to tape using the backup command. ...
    (comp.unix.aix)