mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-26 20:14:47 +01:00
add several docs [ci skip]
This commit is contained in:
parent
b927f15019
commit
b0d8e785b6
125
README.md
125
README.md
@ -144,20 +144,140 @@ this documents was generated by `examples/docgen.php`.
|
||||
### void uv_listen(resource $handle, long $backlog, callable $callback)
|
||||
|
||||
|
||||
### void uv_tcp_connect(resource $handle, string $ipv4_addr, callable $callback)
|
||||
### void uv_tcp_connect(resource $handle, resource $ipv4_addr, callable $callback)
|
||||
|
||||
##### *Description*
|
||||
|
||||
connect to specified ip address and port.
|
||||
|
||||
##### *Parameters*
|
||||
|
||||
*resource $handle*: requires `uv_tcp_init()` resource.
|
||||
*resource $ipv4_addr*: requires uv_sockaddr resource.
|
||||
*callable $callback*: callable variables.
|
||||
|
||||
##### *Return Value*
|
||||
|
||||
*void*:
|
||||
|
||||
##### *Example*
|
||||
|
||||
````php
|
||||
<?php
|
||||
$tcp = uv_tcp_init();
|
||||
uv_tcp_connect($tcp, uv_ip4_addr("127.0.0.1",8080), function($tcp_handle, $status){
|
||||
uv_close($tcp_handle);
|
||||
});
|
||||
|
||||
uv_run();
|
||||
````
|
||||
|
||||
|
||||
### void uv_tcp_connect6(resource $handle, string $ipv6_addr, callable $callback)
|
||||
### void uv_tcp_connect6(resource $handle, resource $ipv6_addr, callable $callback)
|
||||
|
||||
##### *Description*
|
||||
|
||||
connect to specified ip address and port.
|
||||
|
||||
##### *Parameters*
|
||||
|
||||
*resource $handle*: requires `uv_tcp_init()` resource.
|
||||
*resource $ipv4_addr*: requires uv_sockaddr resource.
|
||||
*callable $callback*: callable variables.
|
||||
|
||||
##### *Return Value*
|
||||
|
||||
*void*:
|
||||
|
||||
##### *Example*
|
||||
|
||||
````php
|
||||
<?php
|
||||
$tcp = uv_tcp_init();
|
||||
uv_tcp_connect($tcp, uv_ip6_addr("::1",8080), function($tcp_handle, $status){
|
||||
uv_close($tcp_handle);
|
||||
});
|
||||
|
||||
uv_run();
|
||||
````
|
||||
|
||||
|
||||
### resource uv_timer_init([resource $loop])
|
||||
|
||||
##### *Description*
|
||||
|
||||
initialize timer handle.
|
||||
|
||||
##### *Parameters*
|
||||
|
||||
*resource $loop*: uv_loop resource.
|
||||
|
||||
##### *Return Value*
|
||||
|
||||
*resource $timer*: initialized timer resource.
|
||||
|
||||
##### *Example*
|
||||
|
||||
````php
|
||||
<?php
|
||||
$timer = uv_timer_init();
|
||||
````
|
||||
|
||||
|
||||
### void uv_timer_start(resource $timer, long $timeout, long $repeat, callable $callback)
|
||||
|
||||
##### *Description*
|
||||
|
||||
initialize timer handle.
|
||||
|
||||
##### *Parameters*
|
||||
|
||||
*resource $loop*: uv_loop resource.
|
||||
|
||||
##### *Return Value*
|
||||
|
||||
*resource $timer*: initialized timer resource.
|
||||
|
||||
##### *Example*
|
||||
|
||||
````php
|
||||
<?php
|
||||
$timer = uv_timer_init();
|
||||
uv_timer_start($timer, 100, 100, function($timer, $status){
|
||||
echo "Hello\n";
|
||||
});
|
||||
|
||||
uv_run();
|
||||
````
|
||||
|
||||
|
||||
### void uv_timer_stop(resource $timer)
|
||||
|
||||
##### *Description*
|
||||
|
||||
stop specified timer.
|
||||
|
||||
##### *Parameters*
|
||||
|
||||
*resource $timer*: uv timer resource.
|
||||
|
||||
##### *Return Value*
|
||||
|
||||
*void*:
|
||||
|
||||
##### *Example*
|
||||
|
||||
````php
|
||||
<?php
|
||||
$timer = uv_timer_init();
|
||||
uv_timer_start($timer, 100, 100, function($timer, $status){
|
||||
echo "Hello\n";
|
||||
uv_timer_stop($timer);
|
||||
});
|
||||
|
||||
uv_run();
|
||||
````
|
||||
|
||||
|
||||
### void uv_timer_again(resource $timer)
|
||||
|
||||
@ -511,3 +631,4 @@ TODO:
|
||||
### bool uv_http_parser_execute(resource $parser, string $body, array &$result)
|
||||
|
||||
|
||||
|
||||
|
125
php_uv.c
125
php_uv.c
@ -3014,7 +3014,33 @@ PHP_FUNCTION(uv_listen)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void uv_tcp_connect(resource $handle, string $ipv4_addr, callable $callback)
|
||||
/* {{{ proto void uv_tcp_connect(resource $handle, resource $ipv4_addr, callable $callback)
|
||||
|
||||
##### *Description*
|
||||
|
||||
connect to specified ip address and port.
|
||||
|
||||
##### *Parameters*
|
||||
|
||||
*resource $handle*: requires `uv_tcp_init()` resource.
|
||||
*resource $ipv4_addr*: requires uv_sockaddr resource.
|
||||
*callable $callback*: callable variables.
|
||||
|
||||
##### *Return Value*
|
||||
|
||||
*void*:
|
||||
|
||||
##### *Example*
|
||||
|
||||
````php
|
||||
<?php
|
||||
$tcp = uv_tcp_init();
|
||||
uv_tcp_connect($tcp, uv_ip4_addr("127.0.0.1",8080), function($tcp_handle, $status){
|
||||
uv_close($tcp_handle);
|
||||
});
|
||||
|
||||
uv_run();
|
||||
````
|
||||
*/
|
||||
PHP_FUNCTION(uv_tcp_connect)
|
||||
{
|
||||
@ -3023,7 +3049,33 @@ PHP_FUNCTION(uv_tcp_connect)
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto void uv_tcp_connect6(resource $handle, string $ipv6_addr, callable $callback)
|
||||
/* {{{ proto void uv_tcp_connect6(resource $handle, resource $ipv6_addr, callable $callback)
|
||||
|
||||
##### *Description*
|
||||
|
||||
connect to specified ip address and port.
|
||||
|
||||
##### *Parameters*
|
||||
|
||||
*resource $handle*: requires `uv_tcp_init()` resource.
|
||||
*resource $ipv4_addr*: requires uv_sockaddr resource.
|
||||
*callable $callback*: callable variables.
|
||||
|
||||
##### *Return Value*
|
||||
|
||||
*void*:
|
||||
|
||||
##### *Example*
|
||||
|
||||
````php
|
||||
<?php
|
||||
$tcp = uv_tcp_init();
|
||||
uv_tcp_connect($tcp, uv_ip6_addr("::1",8080), function($tcp_handle, $status){
|
||||
uv_close($tcp_handle);
|
||||
});
|
||||
|
||||
uv_run();
|
||||
````
|
||||
*/
|
||||
PHP_FUNCTION(uv_tcp_connect6)
|
||||
{
|
||||
@ -3033,7 +3085,27 @@ PHP_FUNCTION(uv_tcp_connect6)
|
||||
|
||||
|
||||
/* {{{ proto resource uv_timer_init([resource $loop])
|
||||
|
||||
##### *Description*
|
||||
|
||||
initialize timer handle.
|
||||
|
||||
##### *Parameters*
|
||||
|
||||
*resource $loop*: uv_loop resource.
|
||||
|
||||
##### *Return Value*
|
||||
|
||||
*resource $timer*: initialized timer resource.
|
||||
|
||||
##### *Example*
|
||||
|
||||
````php
|
||||
<?php
|
||||
$timer = uv_timer_init();
|
||||
````
|
||||
*/
|
||||
|
||||
PHP_FUNCTION(uv_timer_init)
|
||||
{
|
||||
int r;
|
||||
@ -3065,6 +3137,30 @@ PHP_FUNCTION(uv_timer_init)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void uv_timer_start(resource $timer, long $timeout, long $repeat, callable $callback)
|
||||
|
||||
##### *Description*
|
||||
|
||||
initialize timer handle.
|
||||
|
||||
##### *Parameters*
|
||||
|
||||
*resource $loop*: uv_loop resource.
|
||||
|
||||
##### *Return Value*
|
||||
|
||||
*resource $timer*: initialized timer resource.
|
||||
|
||||
##### *Example*
|
||||
|
||||
````php
|
||||
<?php
|
||||
$timer = uv_timer_init();
|
||||
uv_timer_start($timer, 100, 100, function($timer, $status){
|
||||
echo "Hello\n";
|
||||
});
|
||||
|
||||
uv_run();
|
||||
````
|
||||
*/
|
||||
PHP_FUNCTION(uv_timer_start)
|
||||
{
|
||||
@ -3089,6 +3185,31 @@ PHP_FUNCTION(uv_timer_start)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void uv_timer_stop(resource $timer)
|
||||
|
||||
##### *Description*
|
||||
|
||||
stop specified timer.
|
||||
|
||||
##### *Parameters*
|
||||
|
||||
*resource $timer*: uv timer resource.
|
||||
|
||||
##### *Return Value*
|
||||
|
||||
*void*:
|
||||
|
||||
##### *Example*
|
||||
|
||||
````php
|
||||
<?php
|
||||
$timer = uv_timer_init();
|
||||
uv_timer_start($timer, 100, 100, function($timer, $status){
|
||||
echo "Hello\n";
|
||||
uv_timer_stop($timer);
|
||||
});
|
||||
|
||||
uv_run();
|
||||
````
|
||||
*/
|
||||
PHP_FUNCTION(uv_timer_stop)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user