Brian Raven wrote:
> 
> Valid points, but as I said I was just fleshing out an existing example.
> I was doing as little work as possible to generate a working, if
> simplistic, demo. In general, for a single process, single threaded,
> multi client server, then select, non-blocking i/o, sysread and syswrite
> would be preferred for a more bomb proof solution. It also need a lot
> more error checking, etc.
> 
> Also, it might be simpler, depending on requirements and design, to just
> call syswrite instead of can_write. If using non-blocking i/o the
> syswrite will either return EWOULDBLOCK or indicate a partial write if
> tcp buffers are full. But yes you would need some mechanism such as a
> queue to retain unsent data to try again later, whichever method you
> chose.

Ah - we mostly agree then.  :)

I think can_write is preferable to non-blocking IO since you can
just write the circuits that 1) have Q'd data waiting to go out and
2) have room to actually write some data.  The can_write on 10 active
clients should have less overhead than 10 actual failed NBing writes
it seems to me.

I've been working on a model slowly.  One of these days, I'll get
time to finish it.  :)

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to