void gras_trp_tcp_socket_close(gras_socket_t *sd);
gras_error_t gras_trp_tcp_chunk_send(gras_socket_t *sd,
- char *data,
- size_t size);
+ const char *data,
+ long int size);
gras_error_t gras_trp_tcp_chunk_recv(gras_socket_t *sd,
char *data,
- size_t size);
+ long int size);
void gras_trp_tcp_exit(gras_trp_plugin_t *plug);
plug->chunk_send = gras_trp_tcp_chunk_send;
plug->chunk_recv = gras_trp_tcp_chunk_recv;
+ plug->flush = NULL; /* nothing's cached */
+
plug->data = (void*)data;
plug->exit = gras_trp_tcp_exit;
}
}
- VERB3("accepted socket %d to %s:%d\n", sd, res->peer_name,res->peer_port);
+ VERB3("accepted socket %d to %s:%d", sd, res->peer_name,res->peer_port);
*dst = res;
*/
gras_error_t
gras_trp_tcp_chunk_send(gras_socket_t *sock,
- char *data,
- size_t size) {
+ const char *data,
+ long int size) {
/* TCP sockets are in duplex mode, don't check direction */
gras_assert0(size >= 0, "Cannot send a negative amount of data");
DEBUG3("write(%d, %p, %ld);", sock->sd, data, size);
if (status == -1) {
- RAISE4(system_error,"write(%d,%p,%d) failed: %s",
- sock->sd, data, (int)size,
+ RAISE4(system_error,"write(%d,%p,%ld) failed: %s",
+ sock->sd, data, size,
strerror(errno));
}
gras_error_t
gras_trp_tcp_chunk_recv(gras_socket_t *sock,
char *data,
- size_t size) {
+ long int size) {
/* TCP sockets are in duplex mode, don't check direction */
gras_assert0(sock, "Cannot recv on an NULL socket");