EventBufferEvent don't work with persistent sockets well

Issue #13 resolved
Former user created an issue

Hi, small example

$base = new EventBase();
$socket = stream_socket_client("tcp://$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