Re: send() kills the process
From: Barry Margolin (barry.margolin_at_level3.com)
Date: 05/30/03
- Next message: Valentin Nechayev: "Re: Expanding environment variables"
- Previous message: Marc Rochkind: "Re: send() kills the process"
- In reply to: Philippe Hamel: "send() kills the process"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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.
- Next message: Valentin Nechayev: "Re: Expanding environment variables"
- Previous message: Marc Rochkind: "Re: send() kills the process"
- In reply to: Philippe Hamel: "send() kills the process"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|