Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Stupid me. Using rand to generate the datatest is not very wise...
[simgrid.git] / include / transport.h
1 /* $Id$ */
2
3 /* transport - low level communication (send/receive bunches of bytes)      */
4
5 /* module's public interface exported to end user.                          */
6
7 /* Authors: Martin Quinson                                                  */
8 /* Copyright (C) 2004 Martin Quinson.                                       */
9
10 /* This program is free software; you can redistribute it and/or modify it
11    under the terms of the license (GNU LGPL) which comes with this package. */
12
13 #ifndef GRAS_TRANSPORT_H
14 #define GRAS_TRANSPORT_H
15
16 typedef struct s_gras_socket gras_socket_t;
17
18 gras_error_t gras_socket_client(const char *host,
19                                 unsigned short port,
20                                 /* OUT */ gras_socket_t **dst);
21 gras_error_t gras_socket_server(unsigned short port,
22                                 /* OUT */ gras_socket_t **dst);
23 void         gras_socket_close(gras_socket_t *sd);
24
25 /* get information about socket */
26 int   gras_socket_my_port  (gras_socket_t *sock);
27 int   gras_socket_peer_port(gras_socket_t *sock);
28 char *gras_socket_peer_name(gras_socket_t *sock);
29
30 /* debuging functions */
31 gras_error_t gras_socket_client_from_file(const char*path,
32                                           /* OUT */ gras_socket_t **dst);
33 gras_error_t gras_socket_server_from_file(const char*path,
34                                           /* OUT */ gras_socket_t **dst);
35                                           
36    
37 #endif /* GRAS_TRANSPORT_H */