Date: Tue, 26 Jun 2018 22:40:00 +0800 (CST) From: kelly <kelly@rsw-power.com> To: questions@freebsd.org Subject: Re: Handheld Inkjet Printer Manufacturer Message-ID: <123b8573.12e8c.16436342a0b.Coremail.kelly@rsw-power.com>
next in thread | raw e-mail | index | archive | help
RGVhciBNYW5hZ2VyLAoKCkdvb2QgZGF5IQoKCldlIGluZGVwZW5kZW50bHkgZGV2ZWxvcGVkIGEg aGFuZGhlbGQgaW5ramV0IHByaW50ZXIgd2l0aCBnb29kIHF1YWxpdHksIHdoaWNoIGlzIHdpZGVs eSB1c2VkIGFuZCBwb3B1bGFyIHRocm91Z2hvdXQgZGlmZmVyZW50IGNvdW50cmllcy4gSG9wZSB0 aGUgYmVsb3cgcHJvZHVjdCBjYW4gaGVscCB5b3Ugc2F2ZSB0aGUgY29zdHMuCgoKRm9sbG93aW5n IGlzIG9uZSBvZiBvdXIgbW9kZWw6Ckl0ZW06IEhhbmRoZWxkIElua2pldCBQcmludGVyIHdpdGgg U29sdmVudCBJbmsgKFF1aWNrIERyeSkKLSBXaXRoIDMuNSBpbmNoIHRvdWNoYWJsZSBzY3JlZW4g dGhhdCB5b3UgY2FuIGVkaXQgdGhlIGNvbnRlbnRzIGRpcmVjdGx5IHZpYSBzY3JlZW4gb3IgaW1w b3J0ZWQgdGhlIGNvbnRlbnRzIGZyb20gVS1kaXNrLgotIFBvcnRhYmxlLCBzaW1wbGUgaW50ZXJm YWNlIGFuZCBlYXN5IHRvIG9wZXJhdGUuCi0gSXQgY2FuIHByaW50IG9uIGRpZmZlcmVudCBraW5k cyBvZiBtYXRlcmlhbHMsIHN1Y2ggYXMgcGFwZXJzLCBjYXJ0b25zLCBwbGFzdGljcywgZ2xhc3Nl cywgd29vZHMsIHN0b25lcywgd2FsbHMsIHN0ZWVscyBwaXBlcywgbWV0YWxzLCBjYWJsZXMsIGZp bG0gbWF0ZXJpYWxzLCBldGMuCi0gSXQgY2FuIHByaW50IENoaW5lc2UsIEVuZ2xpc2ggbGV0dGVy cywgbnVtYmVycywgUVIgY29kZSwgc2NhbiBjb2RlLCBiYXJjb2RlLCBiYXRjaCBjb2RlLCBleHBp cnkgZGF0ZSwgdGltZSwgY291bnRlciwgc3ltYm9scywgbG9nbywgbWFya3MsIHNtYWxsIHBpY3R1 cmVzIGV0Yy4KLVdlIGhhdmUgbGFyZ2UgZGF0YSBzdG9yZSB1cCB0byAyMDAgbWVzc2FnZXMuCi1X ZSBoYXZlIGRpZmZlcmVudCBjb2xvcnMgaW5rOiBibGFjaywgcmVkLCBidWxlLHllbGxvdywgd2hp dGUgYW5kIGludmlzaWJsZSBVViBsaWdodCBpbmsuCiAgICAKQW55IGludGVyZXN0cyBwbGVhc2Ug Y29udGFjdCB1cyBmb3IgbW9yZSBpbmZvcm1hdGlvbi5XZSBjYW4gc2hvdyB5b3Ugb3VyIGJyb2No dXJlIGFuZCB2aWRlby4gU2FtcGxlIGFyZSBhdmFpbGFibGUsIHRvbyEKICAgICAgICAgICAgICAg ICAKVGhhbmtzIGFuZCBSZWdhcmRzLAotLQoKS2VsbHkgQ2hlbgpTYWxlcyBSZXByZXNlbnRhdGl2 ZQpTaGVuemhlbiBTd2Fyb25pa2kgVGVjaG5vbG9neSBDby4sIEx0ZC4gICAgICAgICAKTW9iaWxl ICYgV2hhdHNhcHA6ODYtMTMyNjY2ODU2NjkKU2t5cGU6IGtlbGx5XzMxNjcKV2ViOnd3dy5iZXNo ZW5ncHJpbnRlcnMuY29t From owner-freebsd-questions@freebsd.org Tue Jun 26 16:46:00 2018 Return-Path: <owner-freebsd-questions@freebsd.org> Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEDF11002437 for <freebsd-questions@mailman.ysv.freebsd.org>; Tue, 26 Jun 2018 16:46:00 +0000 (UTC) (envelope-from mailinglist@diamondbox.dk) Received: from mailrelay4-3.pub.mailoutpod1-cph3.one.com (mailrelay4-3.pub.mailoutpod1-cph3.one.com [46.30.212.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F44E78F09 for <freebsd-questions@freebsd.org>; Tue, 26 Jun 2018 16:45:59 +0000 (UTC) (envelope-from mailinglist@diamondbox.dk) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=diamondbox.dk; s=20140924; h=from:subject:date:message-id:to:mime-version:content-type: content-transfer-encoding; bh=692vTTGx/mzLOaNCdrYqEhJNL7MdE8lzOVi/lHritZo=; b=ONiWfiO8VLOMxSR771sxvdijuZGCIZivSDy06Lq+Txf7XwbMACa5FjH5Ciyr2pQzswo2EQYMyFttS vfBHDfG/iavLwd/GOWRmUK6q3A8yg+z/XMAqQNPqUvPBc6YAkJXTzqQLzr+6vQuf53EO9n3mCdwajE Lp+fw8KfuK4vOkcs= X-HalOne-Cookie: 0b39522271104356e613ea325c1887099ba4f046 X-HalOne-ID: 24421df6-795e-11e8-a331-d0431ea8bb10 Received: from diamond.diamondbox.dk (unknown [212.237.134.61]) by mailrelay4.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id 24421df6-795e-11e8-a331-d0431ea8bb10; Tue, 26 Jun 2018 16:29:47 +0000 (UTC) To: FreeBSD Questions <freebsd-questions@freebsd.org> From: Nikolaj Thygesen <mailinglist@diamondbox.dk> Subject: Small buffers for recv() Organization: diamondbox.dk Message-ID: <ebf15bd0-e164-f4e5-cb3e-63a2c08b34e7@diamondbox.dk> Date: Tue, 26 Jun 2018 18:29:49 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: da X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: User questions <freebsd-questions.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/> List-Post: <mailto:freebsd-questions@freebsd.org> List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=subscribe> X-List-Received-Date: Tue, 26 Jun 2018 16:46:00 -0000 Hi, I'm currently writing an application which passes data between sub-programs through non-blocking sockets. Today I experimented (for testing purposes) with using buffers of different sizes for recv(). When I do: recv(fd, reinterpret_cast<char *>(buffer), size_of_buffer, 0); ... with *size_of_buffer* being e.g. 100 I get loads of EAGAIN's, but if I use e.g. 5000 everything works fine. I do understand why performance suffers, but the many EAGAIN's puzzle me a bit - what is the problem? Is there some way of detecting the optimal size to use? Google didn't bring me any closer to an answer. br - Nikolaj FreeBSD fb.diamondbox.dk 11.1-RELEASE FreeBSD 11.1-RELEASE #3 r321520: Wed Jul 26 20:21:21 CEST 2017 user:/usr/obj/usr/src/sys/DIAMOND amd64
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?123b8573.12e8c.16436342a0b.Coremail.kelly>