- under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include "Transport/transport_private.h"
-GRAS_LOG_EXTERNAL_CATEGORY(transport);
-GRAS_LOG_DEFAULT_CATEGORY(transport);
-
-
-gras_error_t
-gras_socket_server(unsigned short port,
- unsigned int bufSize,
- /* OUT */ gras_socket_t **dst) {
-
- gras_error_t errcode;
- gras_trp_plugin_t *tcp;
-
- TRY(gras_trp_plugin_get_by_name("TCP",&tcp));
- TRY( tcp->socket_server(tcp, port, bufSize, dst));
-
- (*dst)->incoming = 1;
- (*dst)->accepting = 1;
-
- TRY(gras_dynar_push(_gras_trp_sockets,dst));
-
- return no_error;
-}
-
-gras_error_t
-gras_socket_client(const char *host,
- unsigned short port,
- unsigned int bufSize,
- /* OUT */ gras_socket_t **dst) {
-
- gras_error_t errcode;
- gras_trp_plugin_t *tcp;
-
- TRY(gras_trp_plugin_get_by_name("TCP",&tcp));
- TRY( (*tcp->socket_client)(tcp, host, port, bufSize, dst));
-
- (*dst)->incoming = 0;
- (*dst)->accepting = 0;
-
- return no_error;
-}