Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Unix + UDP networking
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Unix + UDP networking
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