title: Bi-Directional IPC in ANSI C
body: <p>I need to make a bi-directional communication between two processes, I have tried using a classic client-server connection, in which the client sends a stream of bits to the server, but I don't see how can I make the server reply other than destroying the sockets and switching client-server to server-client.</p>
  
  <p>FYI, the whole idea of this project is to program a Remote Filesystem, and a Filesystem Client, using FUSE to interact with the RFS. And in this case, if i should ask FUSE for the attributes of a directory in the Filesystem Client, FUSE should send the directory path to the RFS and the RFS should answer back with this directory attributes.</p>
  
  <p>I would very much appreciate your comments, suggestions and help on this matter.</p>
  
  <p>thank you very much in advance!</p>
  
  <pre><code>char* receive_variable_stream(int client_desc){         //esta es la mia
  char* buff
  int buff_size=10;
  buff = malloc(buff_size);
  buff_size = recv(client_desc,buff,buff_size,MSG_PEEK);
  buff = realloc(buff,buff_size);
  recv(client_desc,buff,buff_size,MSG_WAITALL);
  return buff;
  </code></pre>
  
  <p>}</p>