node = (char *)str;
- if (!strncmp(node, UDP4, l=UDP4L+1)) {
+ if (!strncmp(node, UDP4":", l=UDP4L+1)) {
family = AF_INET;
type = UDP4;
node += l;
nb = 1;
fcntl(u->sock, F_SETFL, O_NONBLOCK, nb);
- u->connected = TRUE;
-
return TRUE;
}
if (u->connected) {
connect(u->sock, &none, sizeof(none));
- u->connected = FALSE;
return TRUE;
}
}
-MRP_REGISTER_TRANSPORT(udp4, "udp4", dgrm_t, dgrm_resolve,
+MRP_REGISTER_TRANSPORT(udp4, UDP4, dgrm_t, dgrm_resolve,
dgrm_open, dgrm_createfrom, dgrm_close,
dgrm_bind, dgrm_listen, NULL,
dgrm_connect, dgrm_disconnect,
dgrm_sendraw, dgrm_sendrawto,
dgrm_senddata, dgrm_senddatato);
-MRP_REGISTER_TRANSPORT(udp6, "udp6", dgrm_t, dgrm_resolve,
+MRP_REGISTER_TRANSPORT(udp6, UDP6, dgrm_t, dgrm_resolve,
dgrm_open, dgrm_createfrom, dgrm_close,
dgrm_bind, dgrm_listen, NULL,
dgrm_connect, dgrm_disconnect,
dgrm_sendraw, dgrm_sendrawto,
dgrm_senddata, dgrm_senddatato);
-MRP_REGISTER_TRANSPORT(unxdgrm, "unxd", dgrm_t, dgrm_resolve,
+MRP_REGISTER_TRANSPORT(unxdgrm, UNXD, dgrm_t, dgrm_resolve,
dgrm_open, dgrm_createfrom, dgrm_close,
dgrm_bind, dgrm_listen, NULL,
dgrm_connect, dgrm_disconnect,
events = MRP_IO_EVENT_IN | MRP_IO_EVENT_HUP;
t->iow = mrp_add_io_watch(t->ml, t->sock, events, strm_recv_cb, t);
- if (t->iow != NULL) {
- t->connected = TRUE;
-
+ if (t->iow != NULL)
return TRUE;
- }
}
}
events = MRP_IO_EVENT_IN | MRP_IO_EVENT_HUP;
t->iow = mrp_add_io_watch(t->ml, t->sock, events, strm_recv_cb, t);
- if (t->iow != NULL) {
- t->connected = TRUE;
-
+ if (t->iow != NULL)
return TRUE;
- }
else {
close(t->sock);
t->sock = -1;
setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
nb = 1;
fcntl(t->sock, F_SETFL, O_NONBLOCK, nb);
-
- t->connected = TRUE;
return TRUE;
}
t->iow = NULL;
shutdown(t->sock, SHUT_RDWR);
- t->connected = FALSE;
return TRUE;
}
}
-MRP_REGISTER_TRANSPORT(tcp4, "tcp4", strm_t, strm_resolve,
+MRP_REGISTER_TRANSPORT(tcp4, TCP4, strm_t, strm_resolve,
strm_open, strm_createfrom, strm_close,
strm_bind, strm_listen, strm_accept,
strm_connect, strm_disconnect,
strm_sendraw, NULL,
strm_senddata, NULL);
-MRP_REGISTER_TRANSPORT(tcp6, "tcp6", strm_t, strm_resolve,
+MRP_REGISTER_TRANSPORT(tcp6, TCP6, strm_t, strm_resolve,
strm_open, strm_createfrom, strm_close,
strm_bind, strm_listen, strm_accept,
strm_connect, strm_disconnect,
strm_sendraw, NULL,
strm_senddata, NULL);
-MRP_REGISTER_TRANSPORT(unxstrm, "unxs", strm_t, strm_resolve,
+MRP_REGISTER_TRANSPORT(unxstrm, UNXS, strm_t, strm_resolve,
strm_open, strm_createfrom, strm_close,
strm_bind, strm_listen, strm_accept,
strm_connect, strm_disconnect,
" -s, --server run as test server (default)\n"
" -C, --connect connect transport\n"
" For connection-oriented transports, this is automatic.\n"
+ " -a, --address address to use\n"
" -c, --custom use custom messages\n"
" -m, --message use generic messages (default)\n"
" -t, --log-target=TARGET log target to use\n"