title: Sending message to Ratchet WebSocket Server from another script
body: <p>I'm not 100% sure this is worded right, but I have a Ratchet WebSocket server working correctly as a chat service. However, I want to, when a user posts a new thread on the forums, have the server automatically post a message into the chat to notify them all of this new post.</p>
  
  <p>I want to do this via a quick TCP connection upon the creation of this thread. I'm still somewhat new to sockets and this area of server coding. Is there an easy way that PHP can ignore HTTP overhead in connecting to this same-server socket and simply sending a message?</p>
  
  <p>Here's the code I've tried to use as a test, but ratchet does not even say it received a connection or message (ADDR and port are correct, socket_connect returns TRUE):</p>
  
  <pre><code>error_reporting(E_ALL);
  set_time_limit(0);
  ob_implicit_flush();
  $string = "Hello, a new post has been BLAH";
  $Socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
  $Status = socket_connect($Socket, "***", "***");
  $Bytes = socket_write($Socket, $string, strlen($string));
  socket_strerror(socket_last_error());
  socket_close($Socket);
  </code></pre>