PtokaX forum

Development Section => Extensions for PtokaX Lua => Topic started by: Mardeg on 29 April, 2006, 08:17:53

Title: possible to get passive mode slots using this?
Post by: Mardeg on 29 April, 2006, 08:17:53
Currently hubs with a *slots* command only return results from active users.
Could this extension listen on a UDP socket for passive user results of an "active mode" search?
Title: Re: possible to get passive mode slots using this?
Post by: bluebear on 15 May, 2006, 15:09:54
Quote from: Mardeg on 29 April, 2006, 08:17:53
Currently hubs with a *slots* command only return results from active users.
Could this extension listen on a UDP socket for passive user results of an "active mode" search?

You can make a very simple script that can do this.
However, it would be rather resouce full and not recommended on larger hubs.

1. create udp socket
2. broadcast a $Search to all users (e.g. search for xxx, txt, nfo something all plls have)
3. read data from port you want
4. parse the $Sr command and get the slot info
5. do whatever you need to do with this info

If you have any firewall/router you must take the same steps for udp as you do for dc++ client in active mode.
Title: Re: possible to get passive mode slots using this?
Post by: bastya_elvtars on 15 May, 2006, 16:27:21
Doesn't PtokaX already listen on a UDP socket anyway for (useless) serverside search purposes?
Title: Re: possible to get passive mode slots using this?
Post by: bluebear on 16 May, 2006, 11:09:43
Quote from: bastya_elvtars on 15 May, 2006, 16:27:21
Doesn't PtokaX already listen on a UDP socket anyway for (useless) serverside search purposes?

I can't say if ptokax itself listen on a UDP socket for searches, but I doubt it does.
Normally a Direct Connect protocol server do only work with TCP. And for DC
UPD is only used to deliver search results ($SR) to an active mode client.
Title: Re: possible to get passive mode slots using this?
Post by: bastya_elvtars on 16 May, 2006, 12:16:53
PtokaX uses an UDP port for this purpose.