Commit cf6cc012 authored by malosek's avatar malosek

pgm2 receiver working (partly)

parent 72c5c5ff
...@@ -260,7 +260,8 @@ libzmq_la_CFLAGS = -I$(top_srcdir)/foreign/openpgm/@pgm_basename@/openpgm/pgm/in ...@@ -260,7 +260,8 @@ libzmq_la_CFLAGS = -I$(top_srcdir)/foreign/openpgm/@pgm_basename@/openpgm/pgm/in
-DCONFIG_HAVE_GETPROTOBYNAME_R \ -DCONFIG_HAVE_GETPROTOBYNAME_R \
-DCONFIG_BIND_INADDR_ANY \ -DCONFIG_BIND_INADDR_ANY \
-DCONFIG_GALOIS_MUL_LUT \ -DCONFIG_GALOIS_MUL_LUT \
-DGETTEXT_PACKAGE=\'"pgm"\' -DGETTEXT_PACKAGE='"pgm"' \
-DG_LOG_DOMAIN='"Pgm"'
endif endif
if BUILD_NO_PGM if BUILD_NO_PGM
......
...@@ -119,6 +119,8 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_) ...@@ -119,6 +119,8 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_)
if (receiver) { if (receiver) {
pgm_msgv_len = get_max_apdu_at_once (in_batch_size); pgm_msgv_len = get_max_apdu_at_once (in_batch_size);
pgm_msgv = new pgm_msgv_t [pgm_msgv_len]; pgm_msgv = new pgm_msgv_t [pgm_msgv_len];
zmq_log (1, "PGM transport: pgm_msgv_len %i, %s(%i)\n",
(int) pgm_msgv_len, __FILE__, __LINE__);
} }
return 0; return 0;
...@@ -139,6 +141,12 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -139,6 +141,12 @@ int zmq::pgm_socket_t::open_transport (void)
nbytes_processed = 0; nbytes_processed = 0;
pgm_msgv_processed = 0; pgm_msgv_processed = 0;
#ifdef ZMQ_HAVE_OPENPGM1
int pgm_ok = 0;
#elif defined ZMQ_HAVE_OPENPGM2
int pgm_ok = true;
#endif
// Init PGM transport. // Init PGM transport.
// Ensure threading enabled, ensure timer enabled and find PGM protocol id. // Ensure threading enabled, ensure timer enabled and find PGM protocol id.
// //
...@@ -170,8 +178,8 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -170,8 +178,8 @@ int zmq::pgm_socket_t::open_transport (void)
return -1; return -1;
} }
zmq_log (1, "Transport GSI: %s, %s(%i)\n", pgm_print_gsi (&gsi), //zmq_log (1, "Transport GSI: %s, %s(%i)\n", pgm_print_gsi (&gsi),
__FILE__, __LINE__); // __FILE__, __LINE__);
#ifdef ZMQ_HAVE_OPENPGM1 #ifdef ZMQ_HAVE_OPENPGM1
// PGM transport GSRs. // PGM transport GSRs.
...@@ -192,18 +200,17 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -192,18 +200,17 @@ int zmq::pgm_socket_t::open_transport (void)
errno = ENOMEM; errno = ENOMEM;
return -1; return -1;
} }
#endif #elif defined ZMQ_HAVE_OPENPGM2
struct pgm_transport_info_t *res = NULL;
GError *pgm_error = NULL;
#ifdef ZMQ_HAVE_OPENPGM2 if (!pgm_if_get_transport_info (network, NULL, &res, &pgm_error)) {
struct pgm_transport_info_t* res = NULL;
if (!pgm_if_get_transport_info (network, NULL, &res, NULL)) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
res->ti_gsi = gsi; res->ti_gsi = gsi;
res->ti_dport = port_number;
#endif #endif
// If we are using UDP encapsulation update gsr or res. // If we are using UDP encapsulation update gsr or res.
...@@ -214,9 +221,7 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -214,9 +221,7 @@ int zmq::pgm_socket_t::open_transport (void)
g_htons (port_number); g_htons (port_number);
((struct sockaddr_in*)&recv_gsr.gsr_group)->sin_port = ((struct sockaddr_in*)&recv_gsr.gsr_group)->sin_port =
g_htons (port_number); g_htons (port_number);
#endif #elif defined ZMQ_HAVE_OPENPGM2
#ifdef ZMQ_HAVE_OPENPGM2
res->ti_udp_encap_ucast_port = port_number; res->ti_udp_encap_ucast_port = port_number;
res->ti_udp_encap_mcast_port = port_number; res->ti_udp_encap_mcast_port = port_number;
#endif #endif
...@@ -228,10 +233,8 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -228,10 +233,8 @@ int zmq::pgm_socket_t::open_transport (void)
if (rc != 0) { if (rc != 0) {
return -1; return -1;
} }
#endif #elif defined ZMQ_HAVE_OPENPGM2
if (!pgm_transport_create (&g_transport, res, &pgm_error)) {
#ifdef ZMQ_HAVE_OPENPGM2
if (!pgm_transport_create (&g_transport, res, NULL)) {
pgm_if_free_transport_info (res); pgm_if_free_transport_info (res);
// TODO: tranlate errors from glib into errnos. // TODO: tranlate errors from glib into errnos.
errno = EINVAL; errno = EINVAL;
...@@ -241,78 +244,88 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -241,78 +244,88 @@ int zmq::pgm_socket_t::open_transport (void)
pgm_if_free_transport_info (res); pgm_if_free_transport_info (res);
#endif #endif
zmq_log (1, "PGM transport created, %s(%i)\n", __FILE__, __LINE__);
// Common parameters for receiver and sender. // Common parameters for receiver and sender.
// Set maximum transport protocol data unit size (TPDU). // Set maximum transport protocol data unit size (TPDU).
rc = pgm_transport_set_max_tpdu (g_transport, pgm_max_tpdu); rc = pgm_transport_set_max_tpdu (g_transport, pgm_max_tpdu);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
// Set maximum number of network hops to cross. // Set maximum number of network hops to cross.
rc = pgm_transport_set_hops (g_transport, 16); rc = pgm_transport_set_hops (g_transport, 16);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
#ifdef ZMQ_HAVE_OPENPGM2
// Set nonblocking send/recv sockets.
if (!pgm_transport_set_nonblocking (g_transport, true)) {
errno = EINVAL;
return -1;
}
#endif
// Receiver transport. // Receiver transport.
if (receiver) { if (receiver) {
// Set transport->can_send_data = FALSE. // Set transport->can_send_data = FALSE.
// Note that NAKs are still generated by the transport. // Note that NAKs are still generated by the transport.
rc = pgm_transport_set_recv_only (g_transport, false); rc = pgm_transport_set_recv_only (g_transport, false);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
// Set NAK transmit back-off interval [us]. // Set NAK transmit back-off interval [us].
rc = pgm_transport_set_nak_bo_ivl (g_transport, 50*1000); rc = pgm_transport_set_nak_bo_ivl (g_transport, 50*1000);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
// Set timeout before repeating NAK [us]. // Set timeout before repeating NAK [us].
rc = pgm_transport_set_nak_rpt_ivl (g_transport, 200*1000); rc = pgm_transport_set_nak_rpt_ivl (g_transport, 200*1000);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
// Set timeout for receiving RDATA. // Set timeout for receiving RDATA.
rc = pgm_transport_set_nak_rdata_ivl (g_transport, 200*1000); rc = pgm_transport_set_nak_rdata_ivl (g_transport, 200*1000);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
// Set retries for NAK without NCF/DATA (NAK_DATA_RETRIES). // Set retries for NAK without NCF/DATA (NAK_DATA_RETRIES).
rc = pgm_transport_set_nak_data_retries (g_transport, 5); rc = pgm_transport_set_nak_data_retries (g_transport, 5);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
// Set retries for NCF after NAK (NAK_NCF_RETRIES). // Set retries for NCF after NAK (NAK_NCF_RETRIES).
rc = pgm_transport_set_nak_ncf_retries (g_transport, 2); rc = pgm_transport_set_nak_ncf_retries (g_transport, 2);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
// Set timeout for removing a dead peer [us]. // Set timeout for removing a dead peer [us].
rc = pgm_transport_set_peer_expiry (g_transport, 5*8192*1000); rc = pgm_transport_set_peer_expiry (g_transport, 5*8192*1000);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
// Set expiration time of SPM Requests [us]. // Set expiration time of SPM Requests [us].
rc = pgm_transport_set_spmr_expiry (g_transport, 25*1000); rc = pgm_transport_set_spmr_expiry (g_transport, 25*1000);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
...@@ -327,7 +340,7 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -327,7 +340,7 @@ int zmq::pgm_socket_t::open_transport (void)
rc = pgm_transport_set_rxw_max_rte (g_transport, rc = pgm_transport_set_rxw_max_rte (g_transport,
options.rate * 1000 / 8); options.rate * 1000 / 8);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
...@@ -339,7 +352,7 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -339,7 +352,7 @@ int zmq::pgm_socket_t::open_transport (void)
} }
rc = pgm_transport_set_rxw_secs (g_transport, options.recovery_ivl); rc = pgm_transport_set_rxw_secs (g_transport, options.recovery_ivl);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
...@@ -349,7 +362,7 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -349,7 +362,7 @@ int zmq::pgm_socket_t::open_transport (void)
// Set transport->can_recv = FALSE, waiting_pipe wont not be read. // Set transport->can_recv = FALSE, waiting_pipe wont not be read.
rc = pgm_transport_set_send_only (g_transport, TRUE); rc = pgm_transport_set_send_only (g_transport, TRUE);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
...@@ -364,7 +377,7 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -364,7 +377,7 @@ int zmq::pgm_socket_t::open_transport (void)
rc = pgm_transport_set_txw_max_rte (g_transport, rc = pgm_transport_set_txw_max_rte (g_transport,
options.rate * 1000 / 8); options.rate * 1000 / 8);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
...@@ -376,7 +389,7 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -376,7 +389,7 @@ int zmq::pgm_socket_t::open_transport (void)
} }
rc = pgm_transport_set_txw_secs (g_transport, options.recovery_ivl); rc = pgm_transport_set_txw_secs (g_transport, options.recovery_ivl);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
...@@ -400,7 +413,7 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -400,7 +413,7 @@ int zmq::pgm_socket_t::open_transport (void)
// Set interval of background SPM packets [us]. // Set interval of background SPM packets [us].
rc = pgm_transport_set_ambient_spm (g_transport, 8192 * 1000); rc = pgm_transport_set_ambient_spm (g_transport, 8192 * 1000);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
...@@ -412,7 +425,7 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -412,7 +425,7 @@ int zmq::pgm_socket_t::open_transport (void)
rc = pgm_transport_set_heartbeat_spm (g_transport, spm_heartbeat, rc = pgm_transport_set_heartbeat_spm (g_transport, spm_heartbeat,
G_N_ELEMENTS(spm_heartbeat)); G_N_ELEMENTS(spm_heartbeat));
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
...@@ -421,7 +434,7 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -421,7 +434,7 @@ int zmq::pgm_socket_t::open_transport (void)
// Enable multicast loopback. // Enable multicast loopback.
if (options.use_multicast_loop) { if (options.use_multicast_loop) {
rc = pgm_transport_set_multicast_loop (g_transport, true); rc = pgm_transport_set_multicast_loop (g_transport, true);
if (rc != 0) { if (rc != pgm_ok) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
...@@ -433,15 +446,15 @@ int zmq::pgm_socket_t::open_transport (void) ...@@ -433,15 +446,15 @@ int zmq::pgm_socket_t::open_transport (void)
if (rc != 0) { if (rc != 0) {
return -1; return -1;
} }
#endif #elif defined ZMQ_HAVE_OPENPGM2
if (!pgm_transport_bind (g_transport, &pgm_error)) {
#ifdef ZMQ_HAVE_OPENPGM2
if (!pgm_transport_bind (g_transport, NULL)) {
// TODO: tranlate errors from glib into errnos. // TODO: tranlate errors from glib into errnos.
return -1; return -1;
} }
#endif #endif
zmq_log (1, "PGM transport binded, %s(%i)\n", __FILE__, __LINE__);
return 0; return 0;
} }
...@@ -585,26 +598,34 @@ size_t zmq::pgm_socket_t::get_max_apdu_at_once (size_t readbuf_size_) ...@@ -585,26 +598,34 @@ size_t zmq::pgm_socket_t::get_max_apdu_at_once (size_t readbuf_size_)
return apdu_count; return apdu_count;
} }
#ifdef ZMQ_HAVE_OPENPGM1
// Allocate buffer for one packet from the transmit window, The memory buffer // Allocate buffer for one packet from the transmit window, The memory buffer
// is owned by the transmit window and so must be returned to the window with // is owned by the transmit window and so must be returned to the window with
// content via pgm_transport_send() calls or unused with pgm_packetv_free1(). // content via pgm_transport_send() calls or unused with pgm_packetv_free1().
void *zmq::pgm_socket_t::get_buffer (size_t *size_) void *zmq::pgm_socket_t::get_buffer (size_t *size_)
{ {
#ifdef ZMQ_HAVE_OPENPGM1
// Store size. // Store size.
*size_ = get_max_tsdu_size (); *size_ = get_max_tsdu_size ();
// Allocate one packet. // Allocate one packet.
return pgm_packetv_alloc (g_transport, false); return pgm_packetv_alloc (g_transport, false);
#elif ZMQ_HAVE_OPENPGM2
zmq_assert (false);
#endif
} }
// Return an unused packet allocated from the transmit window // Return an unused packet allocated from the transmit window
// via pgm_packetv_alloc(). // via pgm_packetv_alloc().
void zmq::pgm_socket_t::free_buffer (void *data_) void zmq::pgm_socket_t::free_buffer (void *data_)
{ {
#ifdef ZMQ_HAVE_OPENPGM1
pgm_packetv_free1 (g_transport, data_, false); pgm_packetv_free1 (g_transport, data_, false);
} #elif ZMQ_HAVE_OPENPGM2
zmq_assert (false);
#endif #endif
}
// pgm_transport_recvmsgv is called to fill the pgm_msgv array up to // pgm_transport_recvmsgv is called to fill the pgm_msgv array up to
// pgm_msgv_len. In subsequent calls data from pgm_msgv structure are // pgm_msgv_len. In subsequent calls data from pgm_msgv structure are
...@@ -614,7 +635,6 @@ ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_) ...@@ -614,7 +635,6 @@ ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_)
size_t raw_data_len = 0; size_t raw_data_len = 0;
#ifdef ZMQ_HAVE_OPENPGM1
// We just sent all data from pgm_transport_recvmsgv up // We just sent all data from pgm_transport_recvmsgv up
// and have to return 0 that another engine in this thread is scheduled. // and have to return 0 that another engine in this thread is scheduled.
if (nbytes_rec == nbytes_processed && nbytes_rec > 0) { if (nbytes_rec == nbytes_processed && nbytes_rec > 0) {
...@@ -638,6 +658,7 @@ ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_) ...@@ -638,6 +658,7 @@ ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_)
// Receive a vector of Application Protocol Domain Unit's (APDUs) // Receive a vector of Application Protocol Domain Unit's (APDUs)
// from the transport. // from the transport.
#ifdef ZMQ_HAVE_OPENPGM1
nbytes_rec = pgm_transport_recvmsgv (g_transport, pgm_msgv, nbytes_rec = pgm_transport_recvmsgv (g_transport, pgm_msgv,
pgm_msgv_len, MSG_DONTWAIT); pgm_msgv_len, MSG_DONTWAIT);
...@@ -666,10 +687,41 @@ ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_) ...@@ -666,10 +687,41 @@ ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_)
// Catch the rest of the errors. // Catch the rest of the errors.
if (nbytes_rec <= 0) { if (nbytes_rec <= 0) {
zmq_log (2, "received %i B, errno %i, %s(%i)", (int)nbytes_rec, zmq_log (2, "received %i B, errno %i, %s(%i).\n", (int)nbytes_rec,
errno, __FILE__, __LINE__); errno, __FILE__, __LINE__);
errno_assert (nbytes_rec > 0); errno_assert (nbytes_rec > 0);
} }
#elif defined ZMQ_HAVE_OPENPGM2
GError *pgm_error = NULL;
const PGMIOStatus status = pgm_recvmsgv (g_transport, pgm_msgv,
pgm_msgv_len, MSG_DONTWAIT, &nbytes_rec, &pgm_error);
if (nbytes_rec > 0) {
zmq_log (1, "PGMIOStatus %i, nbytes_rec %i, %s(%i).\n",
status, (int) nbytes_rec, __FILE__, __LINE__);
}
// In a case when no ODATA/RDATA fired POLLIN event (SPM...)
// pgm_recvmsg returns ?.
if (status == PGM_IO_STATUS_AGAIN ||
status == PGM_IO_STATUS_AGAIN2) {
// In case if no RDATA/ODATA caused POLLIN 0 is
// returned.
nbytes_rec = 0;
return 0;
}
// Data loss?
if (status != PGM_IO_STATUS_NORMAL) {
zmq_log (1, "PGMIOStatus %i, nbytes_rec %i, %s(%i).\n",
status, (int) nbytes_rec, __FILE__, __LINE__);
nbytes_rec = 0;
return -1;
}
#endif
zmq_log (4, "received %i bytes\n", (int)nbytes_rec); zmq_log (4, "received %i bytes\n", (int)nbytes_rec);
...@@ -677,6 +729,7 @@ ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_) ...@@ -677,6 +729,7 @@ ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_)
zmq_assert (nbytes_rec > 0); zmq_assert (nbytes_rec > 0);
#ifdef ZMQ_HAVE_OPENPGM1
// Only one APDU per pgm_msgv_t structure is allowed. // Only one APDU per pgm_msgv_t structure is allowed.
zmq_assert (pgm_msgv [pgm_msgv_processed].msgv_iovlen == 1); zmq_assert (pgm_msgv [pgm_msgv_processed].msgv_iovlen == 1);
...@@ -686,13 +739,25 @@ ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_) ...@@ -686,13 +739,25 @@ ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_)
// Save current TSI. // Save current TSI.
*tsi_ = pgm_msgv [pgm_msgv_processed].msgv_tsi; *tsi_ = pgm_msgv [pgm_msgv_processed].msgv_tsi;
#elif defined ZMQ_HAVE_OPENPGM2
// Only one APDU per pgm_msgv_t structure is allowed.
zmq_assert (pgm_msgv [pgm_msgv_processed].msgv_len == 1);
struct pgm_sk_buff_t* skb =
pgm_msgv [pgm_msgv_processed].msgv_skb [0];
// Take pointers from pgm_msgv_t structure.
*raw_data_ = skb->data;
raw_data_len = skb->len;
// Save current TSI.
*tsi_ = &skb->tsi;
#endif
// Move the the next pgm_msgv_t structure. // Move the the next pgm_msgv_t structure.
pgm_msgv_processed++; pgm_msgv_processed++;
nbytes_processed +=raw_data_len; nbytes_processed +=raw_data_len;
#endif
zmq_log (4, "sendig up %i bytes\n", (int)raw_data_len); zmq_log (4, "sendig up %i bytes\n", (int)raw_data_len);
return raw_data_len; return raw_data_len;
...@@ -711,9 +776,7 @@ void zmq::pgm_socket_t::process_upstream (void) ...@@ -711,9 +776,7 @@ void zmq::pgm_socket_t::process_upstream (void)
dummy_bytes = pgm_transport_recvmsgv (g_transport, &dummy_msg, dummy_bytes = pgm_transport_recvmsgv (g_transport, &dummy_msg,
1, MSG_DONTWAIT); 1, MSG_DONTWAIT);
#endif #elif defined ZMQ_HAVE_OPENPGM2
#ifdef ZMQ_HAVE_OPENPGM2
zmq_assert (false); zmq_assert (false);
#endif #endif
......
...@@ -119,16 +119,28 @@ namespace zmq ...@@ -119,16 +119,28 @@ namespace zmq
pgm_msgv_t *pgm_msgv; pgm_msgv_t *pgm_msgv;
// How many bytes were read from pgm socket. // How many bytes were read from pgm socket.
#ifdef ZMQ_HAVE_OPENPGM1
ssize_t nbytes_rec; ssize_t nbytes_rec;
#elif defined ZMQ_HAVE_OPENPGM2
size_t nbytes_rec;
#endif
// How many bytes were processed from last pgm socket read. // How many bytes were processed from last pgm socket read.
#ifdef ZMQ_HAVE_OPENPGM1
ssize_t nbytes_processed; ssize_t nbytes_processed;
#elif defined ZMQ_HAVE_OPENPGM2
size_t nbytes_processed;
#endif
// How many messages from pgm_msgv were already sent up. // How many messages from pgm_msgv were already sent up.
#ifdef ZMQ_HAVE_OPENPGM1
ssize_t pgm_msgv_processed; ssize_t pgm_msgv_processed;
#elif defined ZMQ_HAVE_OPENPGM2
size_t pgm_msgv_processed;
#endif
// Size of pgm_msgv array. // Size of pgm_msgv array.
ssize_t pgm_msgv_len; size_t pgm_msgv_len;
// Sender transport uses 2 fd. // Sender transport uses 2 fd.
enum {pgm_sender_fd_count = 2}; enum {pgm_sender_fd_count = 2};
......
...@@ -93,7 +93,7 @@ int zmq::socket_base_t::bind (const char *addr_) ...@@ -93,7 +93,7 @@ int zmq::socket_base_t::bind (const char *addr_)
return 0; return 0;
} }
#if defined ZMQ_HAVE_OPENPGM1 #if defined ZMQ_HAVE_OPENPGM
if (addr_type == "pgm" || addr_type == "udp") { if (addr_type == "pgm" || addr_type == "udp") {
// In the case of PGM bind behaves the same like connect. // In the case of PGM bind behaves the same like connect.
return connect (addr_); return connect (addr_);
...@@ -179,7 +179,7 @@ int zmq::socket_base_t::connect (const char *addr_) ...@@ -179,7 +179,7 @@ int zmq::socket_base_t::connect (const char *addr_)
return 0; return 0;
} }
#if defined ZMQ_HAVE_OPENPGM1 #if defined ZMQ_HAVE_OPENPGM
if (addr_type == "pgm" || addr_type == "udp") { if (addr_type == "pgm" || addr_type == "udp") {
// If the socket type requires bi-directional communication // If the socket type requires bi-directional communication
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment