From owner-freebsd-hackers Fri Nov 26 10:57:55 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.pernet.net (mail.pernet.net [205.229.0.40]) by hub.freebsd.org (Postfix) with ESMTP id 18B3014BC7 for ; Fri, 26 Nov 1999 10:57:53 -0800 (PST) (envelope-from dimwit@pernet.net) Received: from deadpixi.pernet.net (deadpixi.pernet.net [205.229.0.243]) by mail.pernet.net (8.9.1a/8.9.1) with ESMTP id MAA28411 for ; Fri, 26 Nov 1999 12:57:53 -0600 (CST) Date: Fri, 26 Nov 1999 12:57:52 -0600 (CST) From: Rob King X-Sender: jking@deadpixi.pernet.net Reply-To: dimwit@pernet.net To: freebsd-hackers@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi all, I'm writing a server that multiplexes a MySQL connection to several clients. Since the connection has to be shared, I can't fork(), I have to thread. This isn't a problem, except that when I accept() and assign a socket descriptor, the first thread runs fine, but the next thread simply grabs the descriptor (since it's shared) from the previous thread and starts doing all its writing to that socket. Any idea how to get around this? If there's any good example code, please let me know. Thanks, Rob -- dimwit@pernet.net http://ota.pernet.net/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message