downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

gupnp_context_unhost_path> <gupnp_context_set_subscription_timeout
Last updated: Fri, 13 Nov 2009

view this page in

gupnp_context_timeout_add

(PECL gupnp >= 0.1.0)

gupnp_context_timeout_addSets a function to be called at regular intervals

説明

bool gupnp_context_timeout_add ( int $timeout , mixed $callback [, mixed $arg ] )

Sets a function to be called at regular intervals.

パラメータ

context

A context identifier, returned by gupnp_context_new().

timeout

A timeout in miliseconds.

callback

The callback function calling every timeout period of time. Typically, callback function takes on arg parameter.

arg

User data for callback .

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 Create new UPnP context and set callback

<?php

$user_data 
"user data";

function 
timeout_cb($arg)
{
    
printf("Call timeout_cb, user data: '%s'"$arg);
    return 
true;
}

/* Create the UPnP context */
$context gupnp_context_new();

if (!
$context) {
 die(
"Error creating the GUPnP context\n");
}

/* Create root device */
$dev gupnp_root_device_new($context"/devicedesc.xml");

/* Set callback for timeout */
gupnp_context_timeout_add($context5000"timeout_cb"$user_data);

/* Run the main loop */
gupnp_root_device_start($dev);

?>

エラー / 例外

Issues E_WARNING with not valid callback function.

参考



add a note add a note User Contributed Notes
gupnp_context_timeout_add
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites