-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question : dht_get_peers python binding? #602
Comments
I think you should be able to call this function the same way as others, this method is async and the corresponding alert is |
Unfortunately, it seems not the case. I run the program below and it shows
|
I see your version is 1.0.9.0, this is for version >= 1.1.0, branch RC_1_1 or master. |
will take a look for that, thanks! |
That's weird, I can't get any
What do you think? |
Well, I don't have the environment to test with python, but I just coded a java unit test (see https://github.com/frostwire/frostwire-jlibtorrent/blob/libtorrent-RC_1_1/src/test/java/com/frostwire/jlibtorrent/DhtGetPeersTest.java) and it works. Try to get alerts related to DHT stats to see if indeed you are populating your DHT tables |
Find it, I have to put Next problem is (probably specific to python binding) :
|
Yes, a lot missing, working in a PR to add support for |
Ok, it's merged #608, give it a try |
Does that PR cover all issues raised in here? |
I still can't call It does have type which is |
Does it make a difference if they are a function or a property for you? I added both as properties following other alerts as example. Are you able to see them in the properties of the Python object? |
I think it would make sense for them to be functions, to map 1:1 to C++ (the fewer differences between the C++ and python API, the less important it is to have separate documentation for the python bindings) |
Well, I was thinking about this (API design wise). I agree with the documentation point, but I perceive that one reason to have Of course, this is completely subjective and I don't mind looking for the 1:1 map if you think otherwise. |
actually, when I looked at this earlier today, I realized that peers() really should return the vector. At some point I'll deprecate this one and add an overload that does that. |
@ardhipoetra could you give this a try? #617 |
#617 was merged |
Sorry for the late response. I can confirm that the new patch fix this issue. However, talking about performance, it's very hard to get peer reply on the request. In approximately 30 minute with several swarms, I just get 1 reply of the |
Hi @arvidn, where do you like a possible PR to deprecate the current @ardhipoetra have you tried a very popular hash, like the one from a recent ubuntu distribution? |
@aldenml, yes I have. I've tried some from linuxtracker and other common torrent sharing site. I picked up with > 1500 seeder and > 500 leecher |
I can't give you an ETA, but I will try to setup my python environment. In my java tests I get peers in less than 5 seconds. |
@aldenml RC_1_1 would be great |
Did you get around to check the missing replies @aldenml , i did some quick testing on the code mentioned in this thread it appears that more or less no replies comes back. (ports are open etc) |
@Ueland this issue is very old, but I just tested again and I have no problems. Do you have a minimal code to look at it. Async calls and polling alerts can be a little tricky. |
@aldenml Sorry about that, but since the isue was discussed here i took a chance to ask here, let me know if i should move to a new issue :) I have updated OPs gist with a new popular hash for a Ubuntu release: There appears to be a couple of thousand peers for that hash. I let it run for 2-3 minutes, in that time it sent 327 outgoing get_peers, and it recieved 0 dht_get_peers_reply_alert back for that hash. (but i do get other get_peer requests, announces etc) |
@Ueland is this running with |
@aldenml version : 1.1.6.0 to be correct. Is there any specific branch i should try and build to check? |
try |
Ran it for two minutes now, the results are after two minutes 10s: Of the 34 incoming dht get_peers, 20 was for the same hash that i requested, could it be that the messages that should be dht_get_peers_reply_alert are treaded as an incomin dht get_peers? |
strange, I get the |
Hi @Ueland I looked at it, but unfortunately I can't get it work, the problem is that your script uses deprecated API, I tried to create the session with the new settings API, but something is seriously wrong, the settings are not applied. I don't have a proper python environment to continue in a short time, but I can confirm again that this works with my tests in java. |
I see, can i see the java test code somewhere? To see if i can figure it out :) |
Is there any way to do
get_peers
query explicitly in python binding? I sawdht_get_peers
definition inbindings/python/src/session.cpp
that (maybe) calldht_get_peers
insession_impl
.Is this function can be called from session object? how to expose it so I can call it (from where doesn't matter). To be honest I can't understand how the binding works. The way it's defined is the same as
is_dht_running
(picked up as example), but it just won't work.Thanks!
The text was updated successfully, but these errors were encountered: