Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add a flush function; move module init/exit declarations to gras_private; cosmetic...
[simgrid.git] / src / gras / Transport / transport_interface.h
index 4540a5e..3265203 100644 (file)
@@ -22,6 +22,7 @@ gras_error_t gras_trp_chunk_send(gras_socket_t *sd,
 gras_error_t gras_trp_chunk_recv(gras_socket_t *sd,
                                 char *data,
                                 long int size);
+gras_error_t gras_trp_flush(gras_socket_t *sd);
 
 /* Find which socket needs to be read next */
 gras_error_t 
@@ -29,12 +30,6 @@ gras_trp_select(double timeout,
                gras_socket_t **dst);
 
 
-/***
- *** Module declaration 
- ***/
-gras_error_t gras_trp_init(void);
-void         gras_trp_exit(void);
-
 /***
  *** Plugin mecanism 
  ***/
@@ -65,13 +60,16 @@ struct gras_trp_plugin_ {
   void         (*socket_close)(gras_socket_t *sd);
     
   gras_error_t (*chunk_send)(gras_socket_t *sd,
-                            char *data,
+                            const char *data,
                             long int size);
   gras_error_t (*chunk_recv)(gras_socket_t *sd,
                             char *Data,
                             long int size);
 
-  void          *data;
+  /* flush has to make sure that the pending communications are achieved */
+  gras_error_t (*flush)(gras_socket_t *sd);
+
+  void          *data; /* plugin-specific data */
  
    /* exit is responsible for freeing data and telling the OS this plugin goes */
    /* if it's NULL, data gets freed. (ie exit needed only when data contains pointers) */