#include <time.h> /* time() */
-#include "Transport/transport_private.h"
+#include "gras/Transport/transport_private.h"
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(transport,GRAS);
TRY(gras_trp_plugin_new("file",gras_trp_file_setup));
TRY(gras_trp_plugin_new("sg",gras_trp_sg_setup));
+ /* buf is composed, so it must come after the others */
+ TRY(gras_trp_plugin_new("buf", gras_trp_buf_setup));
+
return no_error;
}
*dst = NULL;
DEBUG1("Create a server socket from plugin %s",gras_if_RL() ? "tcp" : "sg");
- TRY(gras_trp_plugin_get_by_name(gras_if_RL() ? "tcp" : "sg",
- &trp));
+ TRY(gras_trp_plugin_get_by_name("buf",&trp));
/* defaults settings */
TRY(gras_trp_socket_new(1,&sock));
*dst = NULL;
- TRY(gras_trp_plugin_get_by_name(gras_if_RL() ? "tcp" : "sg",
- &trp));
+ TRY(gras_trp_plugin_get_by_name("buf",&trp));
DEBUG1("Create a client socket from plugin %s",gras_if_RL() ? "tcp" : "sg");
/* defaults settings */
sock->peer_name = strdup(host?host:"localhost");
/* plugin-specific */
- errcode= (* trp->socket_client)(trp,
- host ? host : "localhost", port,
- sock);
+ errcode= (*trp->socket_client)(trp,
+ host ? host : "localhost", port,
+ sock);
DEBUG3("in=%c out=%c accept=%c",
sock->incoming?'y':'n',
sock->outgoing?'y':'n',
return (sd->plugin->chunk_recv)(sd,data,size);
}
+/**
+ * gras_trp_flush:
+ *
+ * Make sure all pending communications are done
+ */
+gras_error_t
+gras_trp_flush(gras_socket_t *sd) {
+ return (sd->plugin->flush)(sd);
+}
gras_error_t
gras_trp_plugin_get_by_name(const char *name,