3 /* file trp (transport) - send/receive a bunch of bytes in SG realm */
5 /* Note that this is only used to debug other parts of GRAS since message */
6 /* exchange in SG realm is implemented directly without mimicing real life */
7 /* This would be terribly unefficient. */
9 /* Authors: Martin Quinson */
10 /* Copyright (C) 2004 Martin Quinson. */
12 /* This program is free software; you can redistribute it and/or modify it
13 under the terms of the license (GNU LGPL) which comes with this package. */
15 #include "gras_private.h"
16 #include "transport_private.h"
18 GRAS_LOG_EXTERNAL_CATEGORY(transport);
19 GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(trp_sg,transport);
25 void gras_trp_sg_exit(gras_trp_plugin_t *plugin);
26 gras_error_t gras_trp_sg_socket_client(const char *host,
30 /* OUT */ gras_socket_t **dst);
31 gras_error_t gras_trp_sg_socket_server(unsigned short port,
34 /* OUT */ gras_socket_t **dst);
35 void gras_trp_sg_socket_close(gras_trp_sock_t **sd);
36 gras_error_t gras_trp_sg_select(double timeOut,
39 gras_error_t gras_trp_sg_bloc_send(gras_socket_t *sd,
44 gras_error_t gras_trp_sg_bloc_recv(gras_socket_t *sd,
48 gras_error_t gras_trp_sg_flush(gras_socket_t *sd);
51 *** Specific plugin part
55 } gras_trp_sg_specific_t;
58 *** Specific socket part
66 gras_trp_sg_init(void) {
68 gras_trp_sg_specific_t *specific = malloc(sizeof(gras_trp_sg_specific_t));
76 gras_trp_sg_exit(gras_trp_plugin_t *plugin) {
77 gras_trp_sg_specific_t *specific = (gras_trp_sg_specific_t*)plugin->specific;
81 gras_error_t gras_trp_sg_socket_client(const char *host,
85 /* OUT */ gras_trp_sock_t **dst){
89 gras_error_t gras_trp_sg_socket_server(unsigned short port,
92 /* OUT */ gras_trp_sock_t **dst){
96 void gras_trp_sg_socket_close(gras_trp_sock_t **sd){
97 ERROR1("%s not implemented",__FUNCTION__);
101 gras_error_t gras_trp_sg_select(double timeOut,
102 gras_trp_sock_t **sd){
106 gras_error_t gras_trp_sg_bloc_send(gras_trp_sock_t *sd,
113 gras_error_t gras_trp_sg_bloc_recv(gras_trp_sock_t *sd,
120 gras_error_t gras_trp_sg_flush(gras_trp_sock_t *sd){