Avatarchik / lidgren-network-gen3

Automatically exported from code.google.com/p/lidgren-network-gen3
0 stars 0 forks source link

Peer/Discovery Not Working over WAN-IP Connection #57

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have been trying this morning to connect outside of the local area subnet for 
the first time without much success.  Using peer/discovery
inside the local subnet works fine.

I have tried configuring my router virtual server to allow access
to the port.  Also tried turning off all firewalls on both client and server 
which includes windows 7 and anti-virus software.  I have also disabled the 
router firewall, and lastly tried putting the local-ip outside the NAT firewall.

None of these have worked for me.   I have tried pinging the router with 
success.

When the server starts up it says, socket bound to 0.0.0.0:14242.  Is this 
correct? or should it be saying  bound to ip-address:14242?

The very reason to use this system is in this nature so help would be very much 
appreciated as i'm stuck !!!

Great product though :)))

Original issue reported on code.google.com by mark.js...@googlemail.com on 21 Nov 2010 at 8:10

GoogleCodeExporter commented 8 years ago
Your "DiscoverKnownPeer" is not yielding any results when the peers are on 
different sides of the router? This probably means NAT is in the way. You need 
to configure your router to do port forwarding, and make sure your server 
(receiving peer) host doesn't change ip (or you'll have to update the port 
forwarding).
This isn't really an issue of the library; posting on the forums would be more 
appropriate.

Original comment by lidg...@gmail.com on 21 Nov 2010 at 8:32

GoogleCodeExporter commented 8 years ago
I got it working finally.  What was strange is that it works when i dont bother 
using DiscoverKnownPeer. I only exposed my UDP port on the router, did not have 
to put the server outside the NAT, and did not have to turn off the router or 
change setting to my windows 7 firewall.  I did not block the WAN ping on the 
router. Basically it works like a dream!  But one thing i dont understand is 
what is the DiscoveryKnownPeer trying to do?  It did not receive on the server 
side anything?

My client is running through a Mobile Phone Internet Connection on a laptop, my 
server running on a local area subnet behind a router at home.

What does the DiscoveryKnownPeer achieve, when would i have to use it?  It did 
not work for release 151.

Hope this helps others having same issues.

Original comment by mark.js...@googlemail.com on 21 Nov 2010 at 8:18

GoogleCodeExporter commented 8 years ago
DiscoveryKnownPeer works as intended; see the wiki page 
http://code.google.com/p/lidgren-network-gen3/wiki/Discovery - you just have to 
remember to enable the DiscoveryRequest message type on the server (and call 
Server.SendDiscoveryResponse() and enable DiscoveryResponse messages on the 
client.
I've updated the DurableSample so you can see it in action.

Routers keep track of what hosts and ports are trying to communicate, so if 
your code suddenly starts working it just might be that you've tried to send 
packets both ways and the router remembers it - that's the way NAT traversal 
works in practice.

Original comment by lidg...@gmail.com on 21 Nov 2010 at 8:57

GoogleCodeExporter commented 8 years ago
Hello,

I have been facing the following problem for quite some time, I have read this 
thread and others, but I still face this problem:
I cannot connect to a remote server (a server that is not in my local subnet). 

I know this is doable using DiscoverKnwonPeer method. So I have tried the 
DurableSample, because, as mentioned here, it uses this method. I have tried 2 
scenarios: 
A) Server on my local subnet: (SUCCESSFUL)
I run the client on my PC and run the server on another PC in the same local 
subnet. In the client application I give the host name of the PC on which I run 
the server. And things work correctly.
B) Server outside my local subnet: (FAIL)
I run the client on my PC and run the server on another PC in the cloud, 
outside my local subnet. In the client application I give the host name of the 
cloud PC on which I run the server. But the client fails to connect.

What could I possibly do to get it working?
The slightest help is much appreciated.

Original comment by sameh...@gmail.com on 7 May 2013 at 12:09

GoogleCodeExporter commented 8 years ago
Check out firewall issues; try port forwarding.

Original comment by lidg...@gmail.com on 7 May 2013 at 12:15