title: Socket Client Sends one long String rather than 3 Strings
body: <p>I am writing a little client in C which sends three Strings to a Server far away. For example I send &quot;FOO&quot;, &quot;BAR&quot;, &quot;FOOBAR&quot; ill receive &quot;FOOBARFOOBAR&quot; &quot;null&quot;, &quot;null&quot; on the other side.</p>
  <p>Here is my Client Code:</p>
  <pre><code>#include&lt;stdio.h&gt; //printf
  #include&lt;string.h&gt;    //strlen
  #include&lt;sys/socket.h&gt;    //socket
  #include&lt;arpa/inet.h&gt; //inet_addr
  
  int main(int argc , char *argv[])
  {
  int sock;           
  struct sockaddr_in server;
  char message[1000];
   
  //socket Erstellen
  sock = socket(AF_INET , SOCK_STREAM , 0);
  if (sock == -1)
  {
      printf(&quot;Socket konnte nicht Erstellt werden\n&quot;);
  }
  puts(&quot;Socket erstellt\n&quot;);
   
  server.sin_addr.s_addr = inet_addr(&quot;194.94.82.231&quot;);    //Server Adressee
  server.sin_family = AF_INET;                //Typ
  server.sin_port = htons( 7896 );                //Port
  
  //Zum Server Verbinden
  if (connect(sock , (struct sockaddr *)&amp;server , sizeof(server)) &lt; 0)
  {
      perror(&quot;Verbindung Fehlgeschlagen!\n&quot;);
      return 1;
  }
   
  puts(&quot;Verbunden\n&quot;);
   
    /*Eingaben die zum Server gesendet werden sollen*/
  int n=0;
  
      printf(&quot;message : &quot;);
      scanf(&quot;%s&quot; , message);
   
      n = write(sock , message , strlen(message));
      if (n &lt; 0)
          printf(&quot;ERROR writing to socket&quot;);
  
      printf(&quot;message 2: &quot;);
      scanf(&quot;%s&quot; , message);
   
      n = write(sock , message , strlen(message));
      if (n &lt; 0)
          printf(&quot;ERROR writing to socket&quot;);
  
      printf(&quot;message 3: &quot;);
      scanf(&quot;%s&quot; , message);
   
      n = write(sock , message , strlen(message));
      if (n &lt; 0)
          printf(&quot;ERROR writing to socket&quot;);
  
  puts(&quot;\nFertig\n&quot;); 
  close(sock);
  return 0;
  }
  </code></pre>