adding sigpipe handling to send_rcv
adding sigpipe handling to send_rcv