From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 10:57:13 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FE59106566C for ; Mon, 6 Jun 2011 10:57:13 +0000 (UTC) (envelope-from vadim@nuclight.avtf.net) Received: from nuclight.avtf.net (nuclight.avtf.net [82.117.70.99]) by mx1.freebsd.org (Postfix) with ESMTP id 991748FC12 for ; Mon, 6 Jun 2011 10:57:09 +0000 (UTC) Received: from kernblitz.nuclight.avtf.net (vadim@localhost [127.0.0.1]) by nuclight.avtf.net (8.14.4/8.14.4) with ESMTP id p56Av46Y037617; Mon, 6 Jun 2011 17:57:05 +0700 (NOVST) (envelope-from vadim@kernblitz.nuclight.avtf.net) Received: (from vadim@localhost) by kernblitz.nuclight.avtf.net (8.14.4/8.14.4/Submit) id p56Av3u7037614; Mon, 6 Jun 2011 17:57:03 +0700 (NOVST) (envelope-from vadim) Message-Id: <201106061057.p56Av3u7037614@kernblitz.nuclight.avtf.net> To: Maxim Sobolev From: Vadim Goncharov In-Reply-To: <4DEA653F.7070503@FreeBSD.org> References: <201106041601.p54G1Ut7016697@svn.freebsd.org> <4DEA653F.7070503@FreeBSD.org> X-Comment-To: Maxim Sobolev Date: Mon, 6 Jun 2011 17:57:03 +0700 User-Agent: slrn/0.9.9p1 (FreeBSD) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-all@FreeBSD.org Subject: Re: svn commit: r222688 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vadim_nuclight@mail.ru List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 10:57:13 -0000 Hi Maxim Sobolev! On Sat, 04 Jun 2011 10:02:55 -0700; Maxim Sobolev wrote: >> I don't know about the hast internal protocol but the above reads kind of >> wrong to me. > Hmm, not sure what exactly is wrong? Sender does 3 writes to the TCP > socket - 32k, 32k and 1071 bytes, while receiver does one > recv(MSG_WAITALL) with the size of 66607. So I suspect sender's kernel > does deliver two 32k packets and fills up receiver's buffer or > something. And the remaining 1071 bytes stay somewhere in sender's > kernel indefinitely, while recv() cannot complete in receiver's. Using > the same size when doing recv() solves the issue for me. I'm also don't know the hast internal protocol, but the very need to adjust some *user* buffers while using _TCP_ is pretty strange: TCP doesn't depend on sender's behavior only. May be setsockopt(SO_RCVBUF) needs to be used. Also, why recv() is ever there on TCP, instead of read() ? Is that blocking or non-blocking read? In the latter case kqueue(2) is very usfeul. -- WBR, Vadim Goncharov. ICQ#166852181 mailto:vadim_nuclight@mail.ru [Moderator of RU.ANTI-ECOLOGY][FreeBSD][http://antigreen.org][LJ:/nuclight]