Re: php sockets was Re: [PHP] socket_write eats data - solved
| From: | Daniel Souza | Date: | Mon, 15 Sep 2003 08:58:07 +0000 |
| Subject: | Re: php sockets was Re: [PHP] socket_write eats data - solved | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-162612@lists.php.net to get a copy of this message | ||
Probably your problems about "i can send about seven messages per second"
may be relationed to
OS's tcp connection stream buffering... try to flush every fd after write to
it. I wrote a multi-threaded (pcntl_fork())
application in phpcli using many sockets and they worked well... array
iterations are fast and easy too, as they have
only one level... so I believe that this is really relationed to socket
flushing stuffs...you can also use select() to determine
when a fd is ready for write and implement a "write spool"... only a ideia,
but probably will spent more time with the same
results... well.. flush then may resolve it.
Daniel Souza
"Raditha Dissanayake" <jabber@raditha.com> escreveu na mensagem
news:3F646A4C.3070300@raditha.com...
> Hi thomas,
>
> Thomas Weber wrote:
>
> >IMAP? We were talking about IRC,
> >
> Used imap as an example.
>
> > the Internet Relay Chat.
> >In detail, my problems doesn't even refer to IRC directly, as i am
> >developing a server for a html-based webchat, but the server-structure
and
> >the messages are nearly the same.
> >
> Yes my questions was how are you going to maintain the connection
> between two different connectsion. As far as i know sockets cannot be
> serialized in php4.
>
> >Once you realize the basics of socket-multicasting, it is no problem to
> >maintain hundreds of simultanous TCP-connects via arrays of sockets, also
> >called descriptor-sets. PHP seems to directly use the underlying C-
> >libraries, so everything you can imagine is possible.
> >
> Thanx i am aware of it
>
> >
> >
>
> --
> http://www.radinks.com/upload
> Drag and Drop File Uploader.