4thline / cling

UPnP/DLNA library for Java and Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Old documentation (?) Can't use examples

ramizdemiurge opened this issue · comments

The example from here does not work, because there is no class PortMapping.

PortMapping desiredMapping =
        new PortMapping(
                8123,
                "192.168.0.123",
                PortMapping.Protocol.TCP,
                "My Port Mapping"
        );

UpnpService upnpService =
        new UpnpServiceImpl(
                new PortMappingListener(desiredMapping)
        );

upnpService.getControlPoint().search();

So I tried to do this way:

        UpnpService upnpService =
                new UpnpServiceImpl();
        upnpService.getControlPoint().search();

And then I have:

Oct 23, 2018 5:58:04 PM org.fourthline.cling.UpnpServiceImpl <init>
INFO: >>> Starting UPnP service...
Oct 23, 2018 5:58:05 PM org.fourthline.cling.UpnpServiceImpl <init>
INFO: Using configuration: org.fourthline.cling.DefaultUpnpServiceConfiguration
Oct 23, 2018 5:58:05 PM org.fourthline.cling.transport.RouterImpl <init>
INFO: Creating Router: org.fourthline.cling.transport.RouterImpl
Oct 23, 2018 5:58:05 PM org.fourthline.cling.transport.impl.MulticastReceiverImpl init
INFO: Creating wildcard socket (for receiving multicast datagrams) on port: 1900
Oct 23, 2018 5:58:05 PM org.fourthline.cling.transport.impl.MulticastReceiverImpl init
INFO: Joining multicast group: /239.255.255.250:1900 on network interface: enp4s0f2
Oct 23, 2018 5:58:05 PM org.fourthline.cling.transport.impl.StreamServerImpl init
INFO: Created server (for receiving TCP streams) on: /192.168.1.11:44429
Oct 23, 2018 5:58:05 PM org.fourthline.cling.transport.impl.DatagramIOImpl init
INFO: Creating bound socket (for datagram input/output) on: /192.168.1.11
Oct 23, 2018 5:58:05 PM org.fourthline.cling.UpnpServiceImpl <init>
INFO: <<< UPnP service started successfully

It looks like working, but in this way, I do not know port number.
Is there a fresh documentation or some kind of examples?
Thanx

cling-support.jar