https://github.com/widuu/php_nanomsg
PHP Nanomsg Extension Support PHP7 && PHP5
https://github.com/widuu/php_nanomsg
Last synced: about 1 year ago
JSON representation
PHP Nanomsg Extension Support PHP7 && PHP5
- Host: GitHub
- URL: https://github.com/widuu/php_nanomsg
- Owner: widuu
- License: apache-2.0
- Created: 2016-10-20T23:21:07.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-18T13:57:59.000Z (about 9 years ago)
- Last Synced: 2025-04-09T19:17:37.793Z (about 1 year ago)
- Language: C
- Size: 13.7 KB
- Stars: 8
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php_nanomsg
[](https://travis-ci.org/widuu/php_nanomsg)
## Requirements
* PHP 5.3+
* nanomsg 1.0.0
## INSTALL
First , you need to install nanomsg
```
git clone https://github.com/widuu/php_nanomsg.git
phpize
./configure
make CFLAGS="-I/yourpath/nanomsg/1.0.0/include" LDFLAGS="-L/yourpath/nanomsg/1.0.0/lib -lnanomsg"
make install
```
Then add `extension=nanomsg.so` to your `php.ini`.
## Usage Example
```php
bind($address);
$sock2->connect($address);
$sock1->send('It Works!', 0);
$sock2->setOption( NanoMsg::NN_SOL_SOCKET, NanoMsg::NN_RCVTIMEO, 100 );
$value = $sock2->getOption( NanoMsg::NN_SOL_SOCKET, NanoMsg::NN_RCVTIMEO );
$data = $sock2->recv(0, 0);
echo "received: " . $data . "\n";
?>
```