Hi, I'm writing some socket client (fluentd client) with PHP and I have a
question.

I want to retry fwrite or some socket function when I met recoverable errno
(e.g, EAGAIN). but PHP does not have any function to determine errno as far
as I known.

what is the correct way to handle errno?
I'd like to write robust client with PHP but I don't have good idea to
determine errno.


I'm thinking and thinking about this issue long time. I inspired ruby's
errno module (
http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_m_errno.html) and I
just wrote errno extension to check my idea. I think importing errno module
is not a bad idea.

https://github.com/chobie/php-errno/blob/master/php_errno.c
(currently, this lacks const_missing feature so this does not work on some
platform. )


Could you help me out if you guys have good solution about handling socket
error?

Thanks,
Shuhei

Reply via email to