Re: recv() clarification in SCTP sockets API draft

"Brian F. G. Bidulock" <bidulock@openss7.org> Fri, 06 August 2010 00:42 UTC

Return-Path: <bidulock@openss7.org>
X-Original-To: tsvwg@core3.amsl.com
Delivered-To: tsvwg@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 8BAF13A69E1 for <tsvwg@core3.amsl.com>; Thu, 5 Aug 2010 17:42:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.499
X-Spam-Level:
X-Spam-Status: No, score=-2.499 tagged_above=-999 required=5 tests=[AWL=0.100, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VGNJsQ+TO8-8 for <tsvwg@core3.amsl.com>; Thu, 5 Aug 2010 17:42:14 -0700 (PDT)
Received: from gw.openss7.com (gw.openss7.com [206.75.119.236]) by core3.amsl.com (Postfix) with ESMTP id 2BDBD3A6876 for <tsvwg@ietf.org>; Thu, 5 Aug 2010 17:42:13 -0700 (PDT)
Received: from wilbur.pigworks.openss7.net (IDENT:B0+0ppv78T7z5qEHE8man50dCxeBAmiG@ns5.evil.openss7.net [192.168.9.5]) by gw.openss7.com (8.13.8/8.13.8/Debian-3+etch1) with ESMTP id o760gisQ014199; Thu, 5 Aug 2010 18:42:44 -0600
Received: from wilbur.pigworks.openss7.net (IDENT:7XsB44HI7EPjtyxz7Mjqnq/LH+IfxkvG@localhost [127.0.0.1]) by wilbur.pigworks.openss7.net (8.13.8/8.13.8/Debian-3) with ESMTP id o760gics002081; Thu, 5 Aug 2010 18:42:44 -0600
Received: (from brian@localhost) by wilbur.pigworks.openss7.net (8.13.8/8.13.8/Submit) id o760gbqF002078; Thu, 5 Aug 2010 18:42:37 -0600
Date: Thu, 05 Aug 2010 18:42:37 -0600
From: "Brian F. G. Bidulock" <bidulock@openss7.org>
To: Michael Tuexen <Michael.Tuexen@lurchi.franken.de>
Subject: Re: recv() clarification in SCTP sockets API draft
Message-ID: <20100806004237.GA27092@openss7.org>
Mail-Followup-To: Michael Tuexen <Michael.Tuexen@lurchi.franken.de>, Randy Stewart <randall@lakerest.net>, tsvwg@ietf.org
References: <4C5318B7.2060204@hp.com> <A51D8ACD861B7E41BFC7FE5C64BE96481167B001@MTLEXVS01.ulticom.com> <BE1B7EEE-0B46-46D6-8C0C-5D15A278560C@lurchi.franken.de> <A51D8ACD861B7E41BFC7FE5C64BE96481167B015@MTLEXVS01.ulticom.com> <348884DC-5F88-47A8-8219-644ED6B336B4@lakerest.net> <20100805065615.GA30908@openss7.org> <CBBCCCC8-BA0F-48C8-B1AD-A0870356B008@lurchi.franken.de> <20100805190330.GA21832@openss7.org> <87E9E4F4-7464-49B3-A516-4BA4ACA18545@lurchi.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <87E9E4F4-7464-49B3-A516-4BA4ACA18545@lurchi.franken.de>
Organization: http://www.openss7.org/
Dsn-Notification-To: <bidulock@openss7.org>
X-Spam-To: <blockme@openss7.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
Cc: tsvwg@ietf.org, Randy Stewart <randall@lakerest.net>
X-BeenThere: tsvwg@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: bidulock@openss7.org
List-Id: Transport Area Working Group <tsvwg.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tsvwg>
List-Post: <mailto:tsvwg@ietf.org>
List-Help: <mailto:tsvwg-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 06 Aug 2010 00:42:15 -0000

Michael,

Michael Tuexen wrote:                       (Thu, 05 Aug 2010 22:03:58)
> On Aug 5, 2010, at 9:03 PM, Brian F. G. Bidulock wrote:
> > SOCK_SEQPACKET is clearly "reliable".  What do you mean by
> How can I receive "using one or more input operations". I can't
> do that with recv(), recvfrom() or recvmsg(). They drop the
> bytes of the record which do not fit into the buffer. This
> makes it "unreliable". As a receiver I have no idea how big
> the largest message would be. For SCTP we do no want to loose
> parts of the messages.

Both recvmsg() and recv() offer MSG_PEEK.  If the application is
worried about it, it can always peek the message size and provide
a suitably sized buffer before calling recvmsg() or recv() without
MSG_PEEK.  This is one or more input operations.

If the application is not worried about it, it provides a buffer
large enough for the largest valid message, and simply calls
recv().

This does not make recvmsg() nor recv() unreliable for
SOCK_SEQPACKET: it allows the user to specify whether they care
about bytes beyond a maximum message size: which I believe
was the original point in this thread.

--brian

-- 
Brian F. G. Bidulock
bidulock@openss7.org
http://www.openss7.org/