title: Bad access exception in Poco::Net::HTTPClientSession when network connection is lost
body: <p>When I run the following code without a network connection, I get a bad access error on the last line.  </p>
  
  <pre><code>Poco::URI uri(sRemoteLoggingURL);
  
  HTTPClientSession session(uri.getHost(), uri.getPort());
  
  HTTPRequest request(HTTPRequest::HTTP_POST, uri.getPathAndQuery());
  
  request.set("User-Agent", "Poco");
  
  string reqBody = "{\"logMessage\":\""+ message + "\", \"application_name\":\""+ sAppName +"\"}";
  request.setContentLength( reqBody.length() );
  
  std::ostream&amp; sessionStream = session.sendRequest(request);
  </code></pre>
  
  <p>Is this expected behavior? Do I need to check for network connectivity before I try to send a request? If so, how do I do that? I've tried <code>session.connected()</code>, but that is returning false even when I do have a network connection.</p>