GithubHelp home page GithubHelp logo

Comments (8)

adolfintel avatar adolfintel commented on August 16, 2024

An unusual situation for sure, but not unheard of. As far as I know your fix should work, wanna send a PR?

from waifupnp.

oreillymj avatar oreillymj commented on August 16, 2024

Tried opening a PR but didn't want to push to master
How does this look?

@Override
        public void run() {
            boolean foundgw=false;
            Gateway gw=null;
            try {
                byte[] req = this.req.getBytes();
                DatagramSocket s = new DatagramSocket(new InetSocketAddress(ip, 0));
                s.send(new DatagramPacket(req, req.length, new InetSocketAddress("239.255.255.250", 1900)));
                s.setSoTimeout(3000);
                for (;;) {
                    try {
                        DatagramPacket recv = new DatagramPacket(new byte[1536], 1536);
                        s.receive(recv);
                        //System.out.println("Gateway address " + recv.getAddress().getHostAddress());
                        gw = new Gateway(recv.getData(), ip, recv.getAddress());

                        String extIp= gw.getExternalIP();
                        if( (extIp!=null) && (!extIp.equalsIgnoreCase("0.0.0.0")) ){ //Exclude gateways without an external IP
                            gatewayFound(gw);
                            foundgw=true;
                        }
                    } catch (SocketTimeoutException t) {
                        break;
                    } catch (Throwable t) {
                    }
                }
            } catch (Throwable t) {
            }
            if( (!foundgw) && (gw!=null)){ //Pick the last GW if none have an external IP - internet not up yet??
                gatewayFound(gw);
            }
        }

from waifupnp.

adolfintel avatar adolfintel commented on August 16, 2024

Sorry for the late reply
Your code should work. Pushing to master is the right thing to do, pushing to your master will update the PR, it won't go straight to my master.

from waifupnp.

oreillymj avatar oreillymj commented on August 16, 2024

Hi,
Tried to create a PR from InteliJ, but it says the oreillymj @ gmail .com doesn't have the required repo permissions.

from waifupnp.

adolfintel avatar adolfintel commented on August 16, 2024

Here's how it works:

  • Fork this project, you'll see a copy of it in your repos on github
  • Make the changes on your fork
  • Push to your fork
  • On the github page for your fork, you'll see a Pull request button

image

from waifupnp.

oreillymj avatar oreillymj commented on August 16, 2024

Thanks for your patience, hopefully what I've done is correct.

from waifupnp.

adolfintel avatar adolfintel commented on August 16, 2024

Yes, you did it right. You don't have to call the PR "master" though, you should give a quick description of what your PR does.

from waifupnp.

oreillymj avatar oreillymj commented on August 16, 2024

Thanks, yes the Intelij dialog picked that as the default PR name. It wasn't obvious at the time what the field was.

from waifupnp.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.