Swoole extension for hhvm platform.
C++ C Hack PHP Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
config.cmake
config.h
ext_swoole.php
hhvm_swoole.h
swoole.cpp timer Sep 6, 2016
swoole_client.cpp
swoole_timer.cpp
tcp_server.php timer Sep 6, 2016
test.sh
udp_server.php

README.md

hhvm-swoole

Swoole on HHVM.

Build libswoole.so

git clone https://github.com/swoole/swoole-src.git
cd swoole-src
phpize
./configure
cmake .
make swoole_shared
cp lib/libswoole.so.1.8.11 /usr/local/lib/libswoole.so
cp swoole_config.h /usr/local/include
sudo ldconfig

Build hhvm_swoole.so

git clone https://github.com/swoole/hhvm-swoole.git
cd hhvm-swoole
ln -s ../swoole-src/ swoole
cp swoole/config.h config.h
hphpize
cmake .
make

Run

hhvm -vDynamicExtensions.0=./hhvm_swoole.so tcp_server.php
hhvm -vDynamicExtensions.0=./hhvm_swoole.so udp_server.php

HHVM settings

vim /etc/hhvm/php.ini
hhvm.dynamic_extensions[hhvm_swoole] = /root/hhvm-swoole/hhvm_swoole.so

Supported features

  • Swoole\Server->__construct
  • Swoole\Server->on (onWorkerStart/onWorkerStop/onConnect/onClose/onReceive/onPacket/onTask/onFinish)
  • Swoole\Server->set
  • Swoole\Server->start
  • Swoole\Server->task
  • Swoole\Server->send
  • Swoole\Server->sendto
  • Swoole\Server->sendfile
  • Swoole\Server->close
  • Swoole\Server->exist
  • Swoole\Server->getClientInfo