title: (libwebsocket) How to sent a packet on client connection
body: <p>I'm developing a simple websocket server on Linux using libwebsocket lib.<br>
  I need to send an init packet on established event for every client connection.<br>
  If I use </p>
  
  <pre><code>memcpy( p, "init", 4);
  lws_write(wsi, p, 4, LWS_WRITE_TEXT);
  </code></pre>
  
  <p>in </p>
  
  <pre><code>case LWS_CALLBACK_ESTABLISHED:
  </code></pre>
  
  <p>I receive the error</p>
  
  <pre><code>[2018/07/31 18:50:15:5451] ERR: 
  [2018/07/31 18:50:15:5451] ERR: 0000: 81 04 69 6E 69 74         ..init
  [2018/07/31 18:50:15:5451] ERR: 
  [2018/07/31 18:50:15:5451] ERR: ** 0x564b10ce5170: vh: default, prot: lws-minimal, role ws: Illegal back-to-back write of 6 detected...
  </code></pre>
  
  <p>From the documentation I read that I cannot recall <code>lws_write</code> in this phase but  don't understand how to prepare data for the <code>LWS_CALLBACK_SERVER_WRITEABLE</code> phase (and then call <code>lws_callback_on_writable(wsi);</code>..).</p>
  
  <p>Why the error reports 6 bytes when I lws-write 4 bytes?</p>