Re: How to get input from socket client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for your reply

> First, I don't think feof() will do what you think it does. I
> wouldn't expect it to show up until after the other end has actually
> closed the connection.

I found unread_bytes in stream_get_meta_data should be more reliable

> TCP is a stream protocol, there
> are no guarantees about delivering a complete message in one read, or
> that two writes won't be read together. It only guarantees that all
> octets will eventually be delivered in the same order they were sent, or
> you will get an error.

thanks 4 pointing out the difference between tcp and udp, I had learnt a lot ^^

>The other problem has to do with thinking an fread() will always give
>you everything you sent in an fwrite()
Interestingly, I use 'telnet 127.0.0.1 1037' for testing later(on
windows) and everything works, the php server got the input from
telnet client, so I assume there is something wrong in the php client,
the fwrite statement...

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux