title: Client Server -(TCP)
body: <p>I am trying to send some text from the client's end to the server.
  I also want to display time stamps,so as to notify the time at which the message was received.
  When I try sending the time it sends a blank.However the rest of the string gets displayed.</p>
  
  <p>Here my code for sending from the client's end: </p>
  
  <pre><code>void ClientSock::OnConnect(int nErrorCode)
  {
      // TODO: Add your specialized code here and/or call the base class
      if(nErrorCode)
      {
          AfxMessageBox(_T("Connection Failure."));
          Close();
      }
      else
      {
          time_t clock;
          time(&amp;clock);
          char min[30] = {0};
          char s = ctime_s(min,sizeof(min),&amp;clock);
          char text[100] = {0};
          char user[10] = {"UserName"};
          int n = m_pDlg-&gt;GetDlgItemText(ID_REQUEST,text, 100);
          Send(text,n);
          Send(user,sizeof(user));
          Send(min,sizeof(min));
          //m_pDlg-&gt;SetDlgItemText(ID_REQUEST,min);
          AfxMessageBox(_T(min));
      }
  
  }
  </code></pre>
  
  <p>and heres how im printing at the Server's console:</p>
  
  <pre><code>                  SOCKET client;
              char text[100] = {0};
              char user[10] = {0};
              char min[30] = {0};
              int n,m;
              //(here the server waits for the client and accepts connection requests) 
              client  = accept(server, NULL, NULL);
              //(receiving text from the client)
  
              n = recv(client, text, 99, 0);          
              recv(client, user, 9, 0);       
              m = recv(client, min, 29, 0);       
  
              if(n &gt; 0 &amp;&amp; m &gt; 0)
              {
                  printf("%s:: %s:%s\n",min,user,text);
              }               
              else
                  printf("ERROR:Communication Failure.\n");
  </code></pre>