This repository was archived by the owner on Oct 22, 2018. It is now read-only.
forked from minimalparts/PeARS
-
Notifications
You must be signed in to change notification settings - Fork 10
[WIP] Merging the DHT and PeARS parts together #39
Open
nandajavarma
wants to merge
19
commits into
PeARSearch:development
Choose a base branch
from
nandajavarma:NAT_dht
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
393bd1e to
24f8932
Compare
cf98c98 to
42ca0a1
Compare
42ca0a1 to
ff2e50c
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While implementing the NAT traversal, I had to use up a lot of ports to create active UDP listeners. Since we already have active UDP listeners in our DHT, we need not over complicate things with more networking code going in. But this would mean that the DHT and the client instance can no longer remain as separate entities. We will have to fetch the URLs and peer_profile details directly from the DHT. If the PeARS instance and the DHT are parts of a single app, then variable sharing becomes easier. This is what this code does.
This is still a work in progress. The current setup does the searching with or without bootsrapping nodes. But if the bootstrapping node is behind NAT it cannot yet locate it, so will show zero results. It need heavy testing and a lot more love. This PR will be actively updated.
P. S.: To make Flask and Twisted work together, I had to do a lot of hacks here and there. We can change it in the future. Hopefully when the Django thing is ready.