Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66885 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72094 invoked from network); 2 Apr 2013 00:11:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2013 00:11:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=chobieee@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chobieee@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.180 as permitted sender) X-PHP-List-Original-Sender: chobieee@gmail.com X-Host-Fingerprint: 209.85.217.180 mail-lb0-f180.google.com Received: from [209.85.217.180] ([209.85.217.180:51751] helo=mail-lb0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/33-56336-F222A515 for ; Mon, 01 Apr 2013 19:11:28 -0500 Received: by mail-lb0-f180.google.com with SMTP id t11so2394310lbi.25 for ; Mon, 01 Apr 2013 17:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=X9G3XKRnFXRmOyiQU1LMurQ+OdxHMYo3KNyvrre01h4=; b=yJXiX/wWsCDSXhGlInz/JHsYksCYy3lJFMwWBjTr9R+e1Qk/AIr9WEq2Q/jib7rWQj XoT3bBbmZJMtCLuFzhzmoUyGPXMNx4oS78/5X05p3d9No/LDYjQHGYLDphz3U0vWoe0k oz5H6Epd9ZC2TvO4cT+aAisgAsRMN9gvdmxuYMHYxyUJG6OkKS8I0NuCdOMsH4jh0zbT aKxFdRDahZ7IaBYXFSMdsszyd8fPN1P1HlELXOaGEaSIpBFtFYgcwTt5u0yy7OBAN5jL yLT8VT0SufmcNPm4US5rwTebKBuMjMYZst5J9DKHIbstbYzAYpL+Wwdr5Jd7Ss+HJ/t3 HGIw== MIME-Version: 1.0 X-Received: by 10.112.155.9 with SMTP id vs9mr6767472lbb.6.1364861484950; Mon, 01 Apr 2013 17:11:24 -0700 (PDT) Received: by 10.112.6.105 with HTTP; Mon, 1 Apr 2013 17:11:24 -0700 (PDT) Date: Tue, 2 Apr 2013 09:11:24 +0900 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=089e0112c00efa6c7204d95593b1 Subject: how to determine errno on user space? From: chobieee@gmail.com (chobie) --089e0112c00efa6c7204d95593b1 Content-Type: text/plain; charset=ISO-8859-1 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 --089e0112c00efa6c7204d95593b1--