title: ACE c++ send_n and recv_n not working as expected
body: <p>I am trying to implement a basic client-server program using ACE, but the problem is that if I send from client and receive it from server, it works properly. But, when I am increasing the complexity i.e., multiple sends and recvs the programs isn't working. Any help is appreciated.</p>
  
  <p>Here's the client code.</p>
  
  <pre><code>    #include "ace/SOCK_Acceptor.h"
  #include "ace/SOCK_Connector.h"
  #include "ace/SOCK_Stream.h"
  #include "iostream"
  using namespace std;
  int main(){
      ACE_INET_Addr server(7128);
      ACE_SOCK_Connector cli;
      ACE_SOCK_Stream cstream;
      if(cli.connect(cstream, server)==-1){perror("Error");}
      char buff[100];
      if(-1==cstream.recv_n(buff, 7)){printf("Error");}
      cout&lt;&lt;buff&lt;&lt;endl;
      cstream.send_n("FU", 3);
      }
  </code></pre>
  
  <p>Here's the server code</p>
  
  <pre><code>#include "ace/SOCK_Acceptor.h"
  #include "ace/SOCK_Connector.h"
  #include "ace/SOCK_Stream.h"
  #include "iostream"
  using namespace std;
  int main(){
      ACE_INET_Addr server(7128);
      ACE_INET_Addr client;
      ACE_SOCK_Acceptor cli(server);
      ACE_SOCK_Stream cstream;
      if(cli.accept(cstream, &amp;client)==-1){perror("Error");}
      char buff[100];
      if(-1==cstream.send_n("RAND", 5)){printf("Error");}
      cstream.recv_n(buff, 3);
      }
  </code></pre>