"Jimmy" <> wrote:
# They r two processes, for client and server, connected with TCP. Connection
# is OK.
# I killed the server process, while the client seems not to feel that before
# it sent some data by calling send().
# And it checked the errno, which indicated a segmentation fault error.
#
# Why should it be segmentation fault rather than something indicating
# disconnection?
Most likely problem is your error-handling code is blown. You need
to capture the failure and find out where it is happenning. If you
have a debugger, that should point directly to the fault; otherwise
you can sprinkle printfs through the code to verify it is operating
as expected.
If you are using signal handlers, it's not safe to do I/O from there.
--
SM Ryan
http://www.rawbw.com/~wyrmwif/
We found a loophole; they can't keep us out anymore.