How to get remote peer's ip/port

Issue #19 resolved
Former user created an issue

Can not find a way to get remote address/port for incoming connection http://php.net/manual/ru/class.eventlistener.php and http://php.net/manual/ru/class.eventbufferevent.php have not appropriate methods.

There is such method http://php.net/manual/ru/eventhttpconnection.getpeer.php for EventHttpConnection::getSocketName ( string &$address [, mixed &$port ] ) HTTP connection need the same for EventListener

Comments (2)

  1. Ruslan Osmanov repo owner

    Peer IP and port are passed to EventListener's callback. If an EventBufferEvent is based on your socket/stream resource, then you can use EventUtil::getSocketName()

  2. Log in to comment