Content-type: text/html Manpage of MCL_RECV

MCL_RECV

Section: Misc. Reference Manual Pages (2)
Updated:
Index Return to Main Contents

 

NAME

mcl_recv - mcl_recvfrom - receive data from an MCL (MultiCast Library) session

 

SYNOPSIS

#include "../src/common/mcl_lib_api.h"

int mcl_recv (int id, char *buf, int buflen);

int mcl_recvfrom (int id, char *buf, int buflen, struct sockaddr *saddr, int *saddr_len);

 

DESCRIPTION

Receives data from an MCL session, retrieving the source address in case of the mcl_recvfrom() call. These two calls are blocking (synchronous), until data is available or an event occurs.

Calling mcl_recv() or mcl_recvfrom() with an identifier that does not refer to an MCL session leads to calling the recv() or recvfrom() system call with the same parameters.

 

RETURN VALUE

Returns the number of bytes received, or a negative (< 0) value in case of error. Note that issuing an mcl_recv() or mcl_recvfrom() on a session that is closed by the source, or where all objects have been received and returned to the application, triggers an error. This is the usual way of detecting the "end of session" (see example below).

 

EXAMPLE

Here is a simple example (receiving side):

        int     id;
        int     len;
        char    buf[BUFLEN];

        while ((len = mcl_recv(id, buf, BUFLEN)) > 0) {
                <do what needs to be done with data...>
        }
        /* session closed by source */
        mcl_close(id);

 

COPYRIGHTS

Copyright (c) 1999-2003 INRIA - Universite Paris 6 -
All rights reserved
(main author: Vincent Roca - vincent.roca@inrialpes.fr)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

 

SEE ALSO

MCL documentation, recv() or recvfrom() man pages

 

AUTHORS

Vincent Roca (INRIA Rhone-Alpes, Planete project)

$Id: mcl_recv.man.2,v 1.2 2003/10/27 09:55:47 roca Exp $


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
EXAMPLE
COPYRIGHTS
SEE ALSO
AUTHORS

This document was created by man2html, using the manual pages.
Time: 13:49:41 GMT, November 26, 2003