title: ECONNRESET for response.write with return with postman time to time
body: <p>I am working with asp.net 2.0 ashx page that has this code at server side and at client side postman method:</p>
  <pre><code>try {
      if (Request.RequestType == &quot;GET&quot;)
      {
              //..        
      }else if (Request.RequestType == &quot;POST&quot;){       
          if (restMethod == &quot;PostSomeAction&quot;){    
              //some code ...
              if (pifFirma == null){
                  MyCustomResponse myCustomResponse = new MyCustomResponse();
                  myCustomResponse.Code = &quot;NoFirmFound&quot;;
                  myCustomResponse.Message = &quot;No firm was found incoming ip address&quot;;
                  Response.Write(JsonConvert.SerializeObject(myCustomResponse));
                  Response.StatusCode = (int)HttpStatusCode.Forbidden;
                  Response.ContentType = &quot;application/json&quot;;
                  //Response.Flush() //it seems this line gives always ECONNRESET 
                  return;
              }
              //..rest of code
          }
      }
  
  }catch (Exception ex){
      MyCustomResponse myCustomResponse = new MyCustomResponse();
      myCustomResponse.Code = &quot;ErrorOccured&quot;;
      myCustomResponse.Message = &quot;Some Error Occured&quot;;
      Response.Write(JsonConvert.SerializeObject(myCustomResponse));
      Response.StatusCode = (int)HttpStatusCode.InternalServerError;
      Response.ContentType = &quot;application/json&quot;;
      return; 
  }
  </code></pre>
  <p>At postman when I do post action to &quot;PostSomeAction&quot; it gives ECONNRESET time to time and return json message sometimes.</p>
  <p>It seems when I uncomment Response.Flush(), it seems it is always ECONNRESET but not sure.</p>
  <p>And on the other hand, probably at I codes in catch execute, it returns json message successfully.</p>
  <p>Finally, when the code reaches to the end with out any &quot;return&quot;, it seems it always return json message successfully</p>
  <p>What can be cause having ECONNRESET message from postman in above cases? if ssl is the issue should it not give always error. How can be &quot;return&quot; expression factor to this?</p>