Sockets usage

This commit is contained in:
Lorenzo
2014-10-11 00:21:05 +02:00
parent 6daa587ca7
commit 425bda073c
3 changed files with 28 additions and 15 deletions
+19 -1
View File
@@ -49,9 +49,27 @@ Actually we supports two adapters
### Using UDP/IP Adapter
Actually "socket" php library is used for UDP/IP adapter
In order to use the UDP/IP adapter your must have PHP compiled with the `sockets` extension.
To verify if you have the `sockets` extension just issue a:
```bash
php -m | grep sockets
```
If you don't have the `sockets` extension, you can proceed in two ways:
- Recompile your PHP whith the `--enable-sockets` flag
- Or just compile the `sockets` extension extracting it from the PHP source.
1. Download the source relative to the PHP version that you on from [here](https://github.com/php/php-src/releases)
2. Enter in the `ext/sockets` directory
3. Issue a `phpize && ./configure && make -j && sudo make install`
4. Add `extension=sockets.so` to your php.ini
**Usage**
```php
$options = new Options();
$adapter = new UdpAdapter($options);
+2 -1
View File
@@ -11,7 +11,8 @@
"require-dev": {
"phpspec/phpspec": "2.*",
"phpunit/phpunit": "4.*",
"athletic/athletic": "~0.1"
"athletic/athletic": "~0.1",
"ext-sockets": "*"
},
"homepage": "http://www.corley.it/",
"keywords": ["influxdb", "udp", "sdk"],
Generated
+7 -13
View File
@@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "ff63d84450d0ba675f2231b385344e9a",
"hash": "b8984634251cdc10c12d585b63e98fbd",
"packages": [
{
"name": "guzzlehttp/guzzle",
@@ -1627,18 +1627,12 @@
"time": "2013-05-29 02:35:23"
}
],
"aliases": [
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [
],
"stability-flags": [],
"prefer-stable": false,
"platform": [
],
"platform-dev": [
]
"platform": [],
"platform-dev": {
"ext-sockets": "*"
}
}