Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/widuu/php_nanomsg
PHP Nanomsg Extension Support PHP7 && PHP5
https://github.com/widuu/php_nanomsg
Last synced: about 2 months 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 (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-18T13:57:59.000Z (over 7 years ago)
- Last Synced: 2023-08-21T19:58:11.842Z (over 1 year ago)
- Language: C
- Size: 13.7 KB
- Stars: 9
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php_nanomsg
[![Build Status](https://travis-ci.org/widuu/php_nanomsg.svg?branch=master)](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";
?>
```