EventBufferEvent don't work with persistent sockets well

Issue #13 resolved
Anonymous created an issue

Hi, small example

$base = new EventBase();
$socket = stream_socket_client("tcp://127.0.0.1:$port", $errno, $errstr, 30, STREAM_CLIENT_PERSISTENT);

$bev = new EventBufferEvent($base, $socket,
        EventBufferEvent::OPT_CLOSE_ON_FREE | EventBufferEvent::OPT_DEFER_CALLBACKS);

When extension try to construct EventBufferEvent it will have the error "either valid PHP stream or valid PHP socket resource expected"

It happened because persistent socket has different resource with normal socket and don't fetch from macros ZEND_FETCH_RESOURCE_NO_RETURN in src/util.c

Comments (1)

  1. Log in to comment