- // Read the raw data from socket
- $rawData = socket_read($resource, $this->getConfigInstance()->getConfigEntry('tcp_buffer_length'), PHP_NORMAL_READ);
+ /*
+ * Read the raw data from socket. If you change PHP_BINARY_READ to
+ * PHP_NORMAL_READ, this line will endless block. We only have
+ * simultanous threads and no real threads.
+ */
+ $rawData = socket_read($resource, $this->getConfigInstance()->getConfigEntry('tcp_buffer_length'), PHP_BINARY_READ);
+
+ // Debug output of read data length
+ //* NOISY-DEBUG: */ $this->debugOutput('LISTENER: rawData[]=' . strlen($rawData));