From owner-freebsd-net@FreeBSD.ORG Tue Dec 2 04:22:14 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1309A571 for ; Tue, 2 Dec 2014 04:22:14 +0000 (UTC) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9971AB57 for ; Tue, 2 Dec 2014 04:22:13 +0000 (UTC) Received: by mail-wi0-f171.google.com with SMTP id bs8so26721638wib.16 for ; Mon, 01 Dec 2014 20:22:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=iqaCO6cGyZwxrfCXsu6u/Xr4WerN+VNT6XcqAgJDEr4=; b=EYnRIghw+RQjJV0YCM5qH+XEy9s3SrJcpoe/QnOC8al9nVEEOgBaJL4LP2hx78E1GK KTGF+F3qriXeKg7gp+8NK1sH5BGjEga2KM7tj3b2ArTT8OtI0xuEbxvRmY0lGp8avPP8 b99MeUfz3238H4SoqYWXGG76xVgXNHvaeQcQnY9mijrDABCU3Hj8b0u1d+JZwJLb7VSE ETCBCvutKMRUcPgiH3IGBKr5/Y+T97wvwdB1Qr6cbJ5P0I9UPxD9BZmJohK5GIEroM8y MnhgVhhk+pKeG+oQjP6XTKLWRmzdmonxU6lHWdn6cbvj7XqSgS7z0rcueoF45zH2wmTv GAOQ== MIME-Version: 1.0 X-Received: by 10.180.211.84 with SMTP id na20mr1740804wic.41.1417494132099; Mon, 01 Dec 2014 20:22:12 -0800 (PST) Received: by 10.27.130.68 with HTTP; Mon, 1 Dec 2014 20:22:12 -0800 (PST) In-Reply-To: <547D1DC6.8030408@rawbw.com> References: <547C5DD3.90604@rawbw.com> <547D1DC6.8030408@rawbw.com> Date: Tue, 2 Dec 2014 09:52:12 +0530 Message-ID: Subject: Re: Can multiple apps listen for TCP on the same port? From: Someone Somewhere To: Yuri Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 04:22:14 -0000 I think backlog value has no direct implication here. What matters is if the listening socket has been closed after accepting the client connection or not. -Kunal. On 2 December 2014 at 07:32, Yuri wrote: > I figured it out. This is 'nc' from the base, imported from OpenBSD 5.6. > > nc has two flaws in its code: it listens with backlog=5 (not 1), and it > doesn't close the listening socket after accept, only after client is done > communicating. > Fixing these two problems makes my app work. > > I first confused it with net/netcat from ports, which is totally different > codebase, and isn't duplex. Looking into their code confused me into making > original wrong assumptions. > > Thanks! > > Yuri > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >