[zeromq-dev] Handling errors from OpenPGM call pgm_transport_create()
Steven McCoy
steven.mccoy at miru.hk
Fri Dec 18 05:16:43 CET 2009
Hi Hi,
Considering the following code,
if (!pgm_transport_create (&transport, res, &pgm_error)) {
pgm_if_free_transport_info (res);
// TODO: tranlate errors from glib into errnos.
g_error_free (pgm_error);
errno = EINVAL;
return -1;
}
All Glib errors are from the PGM_TRANSPORT_ERROR domain,
Format:
(error code)
(error message)
PGM_TRANSPORT_ERROR_INVAL
Creating receive socket2: unsupported feature.
socket(2) derived errors,
EFAULT -> PGM_TRANSPORT_ERROR_FAULT
EINVAL -> PGM_TRANSPORT_ERROR_INVAL
EPERM -> PGM_TRANSPORT_ERROR_PERM
EMFILE -> PGM_TRANSPORT_ERROR_MFILE
ENFILE -> PGM_TRANSPORT_ERROR_NFILE
ENODEV -> PGM_TRANSPORT_ERROR_NODEV
ENOMEM -> PGM_TRANSPORT_ERROR_NOMEM
ENOPROTOOPT -> PGM_TRANSPORT_ERROR_NOPROTOOPT
* -> PGM_TRANSPORT_ERROR_FAILED /* catch all */
Creating receive socket: %s.
Creating send socket: %s
Creating IP Router Alert (RFC 2113) send socket: %s
--
Steve-o
More information about the zeromq-dev
mailing list