L
L
LittleFatNinja2015-06-04 00:16:16
PHP
LittleFatNinja, 2015-06-04 00:16:16

PHP socket_read. problem with received data?

I write Echo server
a piece of code:

while($client && $msg = socket_read($client, self::MSG_BYTE_LIMIT) ) {
        if ( $msg == 'quit' ) {
          die("Disconnected.\n");
        }

        socket_write($client, $msg);
      }

I connect via telnet, enter quit, and what? and nothing! even if you
crack stupidly, the received $msg does not compare

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Burov, 2015-06-04
@LittleFatNinja

most likely you have "quit\n" there

D
Denis, 2015-06-04
@prototype_denis

Caret symbol?
The solution to your problem with Telnet is already in the dock.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question