GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  XS_GETMSGOPT (3)

.ds Aq ’

NAME

xs_getmsgopt - retrieve message option

CONTENTS

SYNOPSIS

int xs_getmsgopt (xs_msg_t *message, int option_name, void *option_value, size_t *option_len);

DESCRIPTION

The xs_getmsgopt() function shall retrieve the value for the option specified by the option_name argument for the message pointed to by the message argument, and store it in the buffer pointed to by the option_value argument. The option_len argument is the size in bytes of the buffer pointed to by option_value; upon successful completion xs_getsockopt() shall modify the option_len argument to indicate the actual size of the option value stored in the buffer.

The following options can be retrieved with the xs_getmsgopt() function:

XS_MORE

Indicates that there are more message parts to follow after the message. The type of this option is int. 0 means that this is the last message part of a multipart message. 1 means that more message parts will follow.

RETURN VALUE

The xs_getmsgopt() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EINVAL

The requested option option_name is unknown, or the requested option_size or option_value is invalid, or the size of the buffer pointed to by option_value, as specified by option_len, is insufficient for storing the option value.

EXAMPLE

Receiving a multi-part message.

xs_msg_t part;
int more;
size_t more_size = sizeof (more);
while (true) {
    /* Create an empty message to hold the message part */
    int rc = xs_msg_init (&part);
    assert (rc == 0);
    /* Block until a message is available to be received from socket */
    rc = xs_recvmsg (socket, &part, 0);
    assert (rc != -1);
    rc = getmsgopt (&part, XS_MORE, &more, &more_size);
    assert (rc == 0);
    if (more) {
      fprintf (stderr, "more\n");
    }
    else {
      fprintf (stderr, "end\n");
      break;
    }
    xs_msg_close (part);
}

SEE ALSO

xs_msg_data(3) xs_msg_init(3) xs_msg_init_size(3) xs_msg_init_data(3) xs_msg_close(3) xs(7)

AUTHORS

This manual page was written by Chuck Remes <\m[blue]cremes@mac.com\m[][1]>.

NOTES

1. cremes@mac.com  mailto:cremes@mac.com
Search for    or go to Top of page |  Section 3 |  Main Index


Crossroads I/O 1&.2&.0 XS_GETMSGOPT (3) 04/03/2016

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.