From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 39EF3BB9C for ; Mon, 5 Dec 2005 10:41:08 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jB59f7qJ014566 for ; Mon, 5 Dec 2005 10:41:07 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA15782 for ; Mon, 5 Dec 2005 10:41:07 +0100 (MET) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jB59f5sA014561 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 5 Dec 2005 10:41:07 +0100 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1EjDBm-0001nR-00; Mon, 05 Dec 2005 10:03:18 +0000 Date: Mon, 5 Dec 2005 10:03:18 +0000 To: Jonathan Roewen Cc: caml-list@inria.fr Subject: Re: [Caml-list] Unix + UDP networking Message-ID: <20051205100318.GA6870@furbychan.cocan.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i From: Richard Jones X-Miltered: at nez-perce with ID 43940B33.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43940B32.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 recvfrom:01 val:01 recvfrom:01 sockaddr:01 otherlibs:01 sendrecv:01 notepad:01 unix:01 unix:01 wrote:01 functions:01 int:01 int:01 confused:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Mon, Dec 05, 2005 at 03:13:33PM +1300, Jonathan Roewen wrote: > I'm looking at the functions for sending/receiving over a > datagram-based socket, and I'm confused about the return value of > recvfrom. > > val recvfrom : file_descr -> string -> int -> int -> msg_flag list -> > int * sockaddr > > What is the int value returned? The bytes actually read? Have a look at the code in otherlibs/unix/sendrecv.c:unix_recvfrom. The int is the return value from recvfrom(2), which is the number of bytes received, or 0 if the peer has performed a shutdown. Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com