Query: gupnp_context_timeout_add
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
GUPNP_CONTEXT_TIMEOUT_ADD(3) 1 GUPNP_CONTEXT_TIMEOUT_ADD(3) gupnp_context_timeout_add - Sets a function to be called at regular intervalsSYNOPSISbool gupnp_context_timeout_add (resource $context, int $timeout, mixed $callback, [mixed $arg])DESCRIPTIONSets a function to be called at regular intervals.PARAMETERSo $context - A context identifier, returned by gupnp_context_new(3). o $timeout - A timeout in miliseconds. o $callback - The callback function calling every $timeout period of time. Typically, callback function takes on $arg parameter. o $arg - User data for $callback.RETURN VALUESReturns TRUE on success or FALSE on failure.EXAMPLESExample #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 "); } /* Create root device */ $dev = gupnp_root_device_new($context, "/devicedesc.xml"); /* Set callback for timeout */ gupnp_context_timeout_add($context, 5000, "timeout_cb", $user_data); /* Run the main loop */ gupnp_root_device_start($dev); ?>ERRORS/EXCEPTIONS Issues E_WARNING with not valid callback function.SEE ALSOgupnp_context_new(3). PHP Documentation Group GUPNP_CONTEXT_TIMEOUT_ADD(3)
Related Man Pages |
---|
ddi_periodic_add(9f) - opensolaris |
gupnp_context_host_path(3) - php |
event_set(3) - php |
gupnp_control_point_browse_start(3) - php |
gupnp_service_proxy_add_notify(3) - php |
Similar Topics in the Unix Linux Community |
---|
GUPnP 0.3 (GUPnP Tools branch) |
GUPnP 0.1 (GUPnP A/V branch) |