Comments (8)
An unusual situation for sure, but not unheard of. As far as I know your fix should work, wanna send a PR?
from waifupnp.
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.
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.
Hi,
Tried to create a PR from InteliJ, but it says the oreillymj @ gmail .com doesn't have the required repo permissions.
from waifupnp.
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
from waifupnp.
Thanks for your patience, hopefully what I've done is correct.
from waifupnp.
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.
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)
- Help Port Doesn't Forward HOT 24
- [Enhancement] PCP and NAT-PMP HOT 5
- Android compatibility HOT 1
- Publishing to Maven HOT 3
- Closing Port Doesn't Always Work HOT 1
- Allow developers to change the name HOT 1
- Release new changes into a tag HOT 1
- [Enhancement] Refresh UPNP all related stuffs HOT 1
- Resources Never Closed HOT 2
- Question on port refreshing HOT 2
- Upload to Maven Central or similar HOT 12
- License/Permission Issue HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from waifupnp.