Can lidgren-network library connect directly peer to peer given both IP addresses
Asked Answered
B

2

8

I am using lidgen-network library 3 to try and create a peer to peer connection. I am new to network programming which is why i'm using this library.

Using the DiscoverKnownPeer() function i have been able to connect within my network. What i have read online is that i need to do a NAT punchthrough which requires a running server that is outside the router. I am hoping for a solution that doesnt require this extra server.

If i can store both ip addesses on a web server, and get create a web service to send the ip's to each respective client through XML, would I be able to create a peer to peer connection?

Thank you in advance.

Boggess answered 24/9, 2010 at 4:36 Comment(0)
F
4

No, you won't be able to establish a connection through NAT without a rendezvous server

NAT stands in your way because even if you know the IP address, that only gets you as far as the router. The router receives a request coming from the internet, and doesn't know which internal IP to send it to, so it throws it away.

NAT punchthrough works by making both peers send outgoing request to each other, the router then "knows" that packets directed at its public IP on the given port should go to the given computer.

So, you need to connect both computers to an external server not behind NAT, and then use that external server to coordinate connecting the two NAT obscured peers together (this is the peer introduction thing that Lidgren has built in).

Fr answered 4/3, 2011 at 3:37 Comment(1)
I'd like to make p2p internet chat in Delphi Xe8, multi-device application. Is there any way to use Lidgren Network Library in Delphi XE? If yes, can you provide me download link. If NO, Is there any similar Lidgren Network Library for my Delphi XE8?Harwin
A
0

I know this is old but...

You didn't specify that using the DiscoverKnownPeer() was necessary in your setup. If it isn't then you can setup peer to peer by appplying port forwarding rules in your router.

Anaemic answered 2/5, 2011 at 19:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.