From owner-freebsd-hackers Wed Feb 19 06:41:51 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id GAA25879 for hackers-outgoing; Wed, 19 Feb 1997 06:41:51 -0800 (PST) Received: from labs.usn.blaze.net.au (labs.usn.blaze.net.au [203.17.53.30]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id GAA25836 for ; Wed, 19 Feb 1997 06:40:47 -0800 (PST) Received: (from davidn@localhost) by labs.usn.blaze.net.au (8.8.5/8.8.5) id BAA03754; Thu, 20 Feb 1997 01:39:02 +1100 (EST) Message-ID: <19970220013902.53279@usn.blaze.net.au> Date: Thu, 20 Feb 1997 01:39:02 +1100 From: David Nugent To: freebsd-hackers@freebsd.org Subject: "connection refused" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.61 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I'm currently working on a network server that needs to use local creditials on a remote connection, and if that fails, to issue a "connection refused". Now, my understanding of how accept() works, and what the manpages say, I should be able to use sendto() and/or sendmsg() on a socket to achieve this. I've searched the source tree for an example, and I've looked through a fair amount of other source as well, but I'm still not sure how this would be done. Unfortunately, my experience in network programming is mainly with plain tcp clients, and I've never had to do anything like this before. Does anyone have either some small code snippet or a pointer to some code which does something similar? FWIW, I'm using tcp rather than udp for simplicity, although that may change at a later date. Regards, David Nugent - Unique Computing Pty Ltd - Melbourne, Australia Voice +61-3-9791-9547 Data/BBS +61-3-9792-3507 3:632/348@fidonet davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/