Package net.sbbi.upnp.impls

Examples of net.sbbi.upnp.impls.InternetGatewayDevice


        if ( item != null ) {

            boolean success = false;
           
            try {
                InternetGatewayDevice device = (InternetGatewayDevice) item;
                success = UPNP.forwardPort( device, sv.getPort() );
            }
            catch ( Exception e ) {}
           
            JOptionPane.showMessageDialog( this,
View Full Code Here


       
        try {
            InternetGatewayDevice[] IGDs = InternetGatewayDevice.getDevices(discoveryTimeout);
            if (IGDs != null) {
                // let's the the first device found
                InternetGatewayDevice testIGD = IGDs[0];
                System.out.println("Found device " + testIGD.getIGDRootDevice().getModelName());
                // now let's open the port
                String localHostIP = InetAddress.getLocalHost().getHostAddress();
                // we assume that localHostIP is something else than 127.0.0.1
                boolean mapped = testIGD.addPortMapping("Some mapping description",
                        null, port, port,
                        localHostIP, 0, "TCP");
                if (mapped) {
                    System.out.println("Port " + port + " mapped to " + localHostIP);
                }
View Full Code Here

    public static boolean closePort(int port) {
        try {
            InternetGatewayDevice[] IGDs = InternetGatewayDevice.getDevices(discoveryTimeout);
            if (IGDs != null) {
                // let's the the first device found
                InternetGatewayDevice testIGD = IGDs[0];
                System.out.println("Found device " + testIGD.getIGDRootDevice().getModelName());
                // now let's open the port
                String localHostIP = InetAddress.getLocalHost().getHostAddress();
                // we assume that localHostIP is something else than 127.0.0.1
                boolean unmapped = testIGD.deletePortMapping(null, port, "TCP");
                if (unmapped) {
                    System.out.println("Port " + port + " unmapped");
                }

                return unmapped;
View Full Code Here

TOP

Related Classes of net.sbbi.upnp.impls.InternetGatewayDevice

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.