title: recv function for winsock socket
body: <p>I have a server application which is connected with telnet client(i.e. telnet localhost _port_num - here port number is same associated with the server application),</p>
  
  <p>My application works correctly, but the thing is I used recv as follows:</p>
  
  <pre><code>#define BUFLEN 512
  char buf[BUFLEN];
  iResult = recv(sd, (char *)buf, BUFLEN, 0);
  </code></pre>
  
  <p>here recv call returns as soon as any character pressed over the connected telnet terminal, and most of the time iResult is <code>1</code> or some times <code>2</code>, Even though I wouldn't press enter telnet client sends frame containing a single character to the server application.</p>
  
  <p>How can I make sure that recv should return after BUFLEN read ?
  In case of linux recv works as expected, get blocks until <code>enter</code>.</p>
  
  <p>Any help or pointers are greatly appreciated.</p>