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,
29 /* OUT */ gras_socket_t **dst);
30 gras_error_t gras_trp_sg_socket_server(unsigned short port,
32 /* OUT */ gras_socket_t **dst);
33 void gras_trp_sg_socket_close(gras_socket_t **sd);
34 gras_error_t gras_trp_sg_select(double timeOut,
37 gras_error_t gras_trp_sg_bloc_send(gras_socket_t *sd,
42 gras_error_t gras_trp_sg_bloc_recv(gras_socket_t *sd,
46 gras_error_t gras_trp_sg_flush(gras_socket_t *sd);
49 *** Specific plugin part
53 } gras_trp_sg_specific_t;
56 *** Specific socket part
64 gras_trp_sg_init(gras_trp_plugin_t **dst) {
66 gras_trp_sg_specific_t *specific = malloc(sizeof(gras_trp_sg_specific_t));
74 gras_trp_sg_exit(gras_trp_plugin_t *plugin) {
75 gras_trp_sg_specific_t *specific = (gras_trp_sg_specific_t*)plugin->specific;
79 gras_error_t gras_trp_sg_socket_client(const char *host,
82 /* OUT */ gras_socket_t **dst){
86 gras_error_t gras_trp_sg_socket_server(unsigned short port,
88 /* OUT */ gras_socket_t **dst){
92 void gras_trp_sg_socket_close(gras_socket_t **sd){
93 ERROR1("%s not implemented",__FUNCTION__);
97 gras_error_t gras_trp_sg_select(double timeOut,
102 gras_error_t gras_trp_sg_bloc_send(gras_socket_t *sd,
109 gras_error_t gras_trp_sg_bloc_recv(gras_socket_t *sd,
116 gras_error_t gras_trp_sg_flush(gras_socket_t *sd){