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_set_subscription_timeout> <gupnp_context_host_path
[edit] Last updated: Fri, 25 May 2012

view this page in

gupnp_context_new

(PECL gupnp >= 0.1.0)

gupnp_context_newCrea un nuevo contexto

Descripción

resource gupnp_context_new ([ string $host_ip [, int $port = 0 ]] )

Crea un nuevo contexto con la ip y puerto específicado.

Parámetros

host_ip

La dirección IP local, o NULL para usar la dirección IP de la primera interfaz de red sin loopback.

port

Puerto a utilizar, o 0 si usted no le importa definir un puerto.

Valores devueltos

Un identificador de contexto.

Ejemplos

Ejemplo #1 Crea un nuevo contexto UPnP

<?php

/* Crea un nuevo contexto UPnP */
$context gupnp_context_new();

if (!
$context) {
 die(
"Error creando el contexto GUPnP \n");
}

?>

Errores/Excepciones

Lanza un E_WARNING cuando es incapaz de crear un contexto.



add a note add a note User Contributed Notes gupnp_context_new
flanker_forever at hotmail dot com 27-Apr-2012 09:04
gupnp_context_new only allow you to use a specific network interface, not an ip address.

In gupnp-context.c we get :
gupnp_context_new (GMainContext *main_context, const char   *interface, guint  port, GError      **error)

with @interface: The network interface to use, or %NULL to auto-detect.

ie use $context = gupnp_context_new("eth0");

NOT $context = gupnp_context_new("1.2.3.4");

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