title: Boost asio short read error after websocket timer tick
body: <p>I'm trying to connect to a secure websocket using websocketpp but I'm getting this weird error after the second tick of the timer:</p>
  
  <pre><code>[2019-12-05 10:48:55] [info] asio async_read_at_least error: asio.ssl:335544539 (short read)
  [2019-12-05 10:48:55] [error] handle_read_frame error: websocketpp.transport:11 (Generic TLS related error)
  [2019-12-05 10:48:55] [info] asio async_write error: asio.ssl:336396495 (protocol is shutdown)
  [2019-12-05 10:48:55] [fatal] handle_write_frame error: websocketpp.transport:2 (Underlying Transport Error)
  [2019-12-05 10:48:55] [info] asio async_shutdown error: asio.ssl:335544539 (short read)
  close handler: Underlying Transport Error
  [2019-12-05 10:48:55] [disconnect] Disconnect close local:[1006,Underlying Transport Error] remote:[1000]
  </code></pre>
  
  <p>My code is:</p>
  
  <pre><code>#define _WEBSOCKETPP_CPP11_STL_
  #   ifdef _WIN32
  #       pragma warning(disable: 4503)
  #       pragma warning(disable: 4996)
  #   endif
  #   include &lt;websocketpp/config/asio_client.hpp&gt;
  #   include &lt;websocketpp/client.hpp&gt;
  #   include &lt;websocketpp/frame.hpp&gt;
  #undef _WEBSOCKETPP_CPP11_STL_
  
  #include &lt;iostream&gt;
  
  using WSClient = websocketpp::client&lt;websocketpp::config::asio_tls_client&gt;;
  
  int main()
  {
      WSClient client;
  
      client.init_asio();
  
      client.set_tls_init_handler([](auto)
      {
          auto result = websocketpp::lib::make_shared&lt;boost::asio::ssl::context&gt;(boost::asio::ssl::context::sslv23_client);
  
          result-&gt;set_verify_mode(boost::asio::ssl::verify_none);
  
          return result;
      });
  
      client.set_open_handler([&amp;client](auto hdl)
      {
          client.set_timer(40000, [hdl, &amp;client](auto)
          {
              if (auto con = client.get_con_from_hdl(hdl)) {
                  con-&gt;send(std::string(R"({"op":1,"d":1})"), websocketpp::frame::opcode::text);
              }
          });
      });
  
      client.set_close_handler([&amp;client](auto hdl)
      {
          auto con = client.get_con_from_hdl(hdl);
          std::cout &lt;&lt; "close handler: " &lt;&lt; con-&gt;get_ec().message() &lt;&lt; std::endl;
      });
  
      client.set_fail_handler([&amp;client](auto hdl)
      {
          auto con = client.get_con_from_hdl(hdl);
          std::cout &lt;&lt; "fail handler: " &lt;&lt; con-&gt;get_ec().message() &lt;&lt; std::endl;
      });
  
      websocketpp::lib::error_code ec;
  
      const auto websocketUrl = "wss://gateway.discord.gg/?encoding=json&amp;v=6";
  
      auto con = client.get_connection(websocketUrl, ec);
  
      if (ec) {
          std::cout &lt;&lt; "Could not create WebSocket connection because " &lt;&lt; ec.message() &lt;&lt; std::endl;
          return 0;
      }
  
      client.connect(con);
      client.run();
  }
  </code></pre>
  
  <p>Surprising thing is that if I do the same thing using NodeJS it works fine using:</p>
  
  <pre><code>const WebSocket = require('ws');
  
  let websocketUrl = 'wss://gateway.discord.gg/?encoding=json&amp;v=6'
  
  const ws = new WebSocket(websocketUrl);
  
  ws.on('open', function() {
      setInterval(() =&gt; {
          console.log('ping');
  
          ws.send('{"op":1,"d":1}');
      }, 40000);
  });
  
  ws.on('error', function(e, v){
      console.log('error', e, v);
  });
  
  ws.on('unexpected-response', function(e, t, v){
      console.log('unexpected-response', e, t);
  });
  
  ws.on('close', function() {
      console.log('connection closed');
  });
  </code></pre>
  
  <p>What am I doing wrong in the C++ version ?</p>
  
  <p>Env: Windows 10, MSVC 14, Websocketpp 0.8.1, Boost 1.69</p>