title: How can I cause an ECONNRESET in recv() from a client?
body: <p>I am using a server that is crashing following a call to recv() returning -1 and errno set to ECONNRESET.  I originally found this condition using nmap (I'm not a cracker, was just testing if the port was open at the time.)  However, nmap uses raw sockets so I'm not too happy submitting this as a test case to the developers.  I would rather write a client program in C that can cause the ECONNRESET.</p>
  
  <p>So far I have tried two things: connect() to the server from my client and then shutdown() the socket immediately after connecting.  recv() on the server still returned 1 (I have inserted debugging code so I can see the return value.)  I also tried calling send() with some string and then immediately calling shutdown().  No dice, the string was transmitted fine.</p>
  
  <p>So how would I cause this condition?  Non portable is fine, I am using Linux.</p>