Hi all,

I'm writting a little telnet client, but I've a problem with the socket_write 

        public function send($data){
                $datalen = strlen($data);
                $datawritten = 0;
                do {
                        $datawritten = socket_write($this->_tnsocket, $data, 
                        if( $datawritten === FALSE) {
                                echo __METHOD__." : 
                                return (FALSE);
                        echo "Bytes written : ".$datawritten."\n";
                        $data = substr($data, $datawritten);
                        $datalen = strlen($data);
                } while($datawritten < $datalen);

                return (TRUE);

When I use this function for writting a sample message of 4526 Bytes it returns 
        Bytes written : 4526
But it really wrotes only 1460 Bytes (verified with Wireshark).

So my question is why socket_write returns me a wrong data length ?


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to