略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: gupnp_control_point_browse_start

2024-12-21

gupnp_control_point_browse_start

(PECL gupnp >= 0.1.0)

gupnp_control_point_browse_startStart browsing

说明

gupnp_control_point_browse_start ( resource $cpoint ) : bool

Start the search and calls user-defined callback.

参数

cpoint

A control point identifier, returned by gupnp_control_point_new().

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

范例

Example #1 Create new UPnP context and start browsing

<?php

function device_proxy_available_cb($proxy$arg)
{
    
$info gupnp_device_info_get($proxy);

    
$type $info['device_type'];
    
$location $info['location'];

    
printf("Device available:\n");
    
printf("type:     %s\n"$type);
    
printf("location: %s\n"$location);
}

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

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

/* We're interested in everything */
$cp gupnp_control_point_new($context"ssdp:all");

gupnp_control_point_callback_set($cp
    
GUPNP_SIGNAL_DEVICE_PROXY_AVAILABLE'device_proxy_available_cb');

/* Start for browsing */
gupnp_control_point_browse_start($cp);

?>

参见

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/function.gupnp-control-point-browse-start.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3