https://github.com/huanghantao/tinyswoole
a php server extension
https://github.com/huanghantao/tinyswoole
c php php-extension php7 swoole
Last synced: 10 months ago
JSON representation
a php server extension
- Host: GitHub
- URL: https://github.com/huanghantao/tinyswoole
- Owner: huanghantao
- Created: 2018-11-20T10:37:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-22T06:48:22.000Z (over 7 years ago)
- Last Synced: 2025-04-11T03:43:36.580Z (about 1 year ago)
- Topics: c, php, php-extension, php7, swoole
- Language: C
- Homepage:
- Size: 223 KB
- Stars: 25
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Description
a tiny [swoole](https://github.com/swoole/swoole-src)
## Create server
```php
start();
```
## Set parameters
```php
$serv->set([
'reactor_num' => 2,
]);
```
## Add the server start event callback
```php
on("Start", "onStart");
$serv->start();
```
## Add the server connect event callback
```php
on("Connect", "onConnect");
$serv->start();
```
## Add the server receive event callback
```php
on("Receive", "onReceive");
$serv->start();
```
## send data to client
```php
$serv->send($fd, "hello world");
```
## Install from source
```shell
git clone git@github.com:huanghantao/tinyswoole.git && \
cd tinyswoole && \
phpize && \
./configure && \
make && make install
```
## Welcome
QQ group:942858122