Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   General Gnutella Development Discussion (https://www.gnutellaforums.com/general-gnutella-development-discussion/)
-   -   Any ASP coders here? (https://www.gnutellaforums.com/general-gnutella-development-discussion/11208-any-asp-coders-here.html)

Paradog May 10th, 2002 02:59 AM

Any ASP coders here?
 
I ppl,
I am looking for some ASP coders around here who
like to join me coding a Gnutellatracker for ASP (maybe an ASP object maybe just pure ASP code).
Since I dont know the Gnutella Protocol (although i read it) I could need some help.

Several ppl coding brings more motivation :)

cultiv8r May 15th, 2002 04:18 PM

"Tracker"?
 
What's the actual purpose of this "tracker" (ie., What is it supposed to do) If you could provide a little more details, people might be able to further help you.

-- Mike

Paradog May 16th, 2002 06:34 AM

I thought about a tracker like the hotline tracker.
You can search for files directly on a server. The advantage
is that the server has more bandwitdh and is probably connected
to more nodes. After the server puts out the ips of the pcs
sharing that file you can connect directly to them.

Also I wanted to create a hostcache for ASP.

tshdos May 17th, 2002 04:31 PM

The hostcache would be very easy to create. It should be made compatible with the GWebCache so clients that existing clients ( such as Gnucleus ) can use it.

The tracker could be a good idea if implemented correctly. I assume you would want it to function like a QueryHit cache. If it is to be used for client applications it could be of benefit. If you intend to allow web users to access it ( ie Browsers ), it could be bad for the network since the users downloading will not be uploading. This would be bad because clients that are actively participating in the network will have a harder time downloading. Also, I believe at least a couple of clients may be blocking web browsers.

In any case, if you would like some help creating these I would be willing to help.

tshdos May 17th, 2002 08:06 PM

1 Attachment(s)
Here is an example of an ASP web cache that is compatible with GWebCache 0.6.1.

Paradog May 18th, 2002 12:34 AM

****,
Why didnt I found that one?
I thought I was coding the first one. :(

Anyway,
I think I will proceed with that coding.
I mean maybe it can get better? :)

Paradog May 18th, 2002 12:37 AM

Earlier there was a tracker called
GNUfrog. It lists all files you search for and
downloads them with BearShare (*shiver*).
It seemed that this feature was only usable in
BearShare.

But I tried to access that page few days ago
and it has been shut down (or changed the URL).

Earlier it was:
www.gnufrog.com

slopper May 18th, 2002 04:54 AM

questions about the code
 
looking at the code, i have two questions:

why do you put CALL in front of your procedure-calls ?

why do you lock the app, for example when increasing a variable:

Application.Lock
Application("something") = Application ("something") + 1
Application.Unlock

what would happen if the app would not be locked during that line ?

Thank you !

Paradog May 18th, 2002 05:20 AM

If two user load that code at exactly the same time
the program would count the hits wrong.

If you lock it the counting will be queued.

Hope this helps.

tshdos May 18th, 2002 09:25 AM

Quote:

why do you put CALL in front of your procedure-calls ?
Just a habit. ASP doesn't require it but I have used it for years with VB.

Paradog May 19th, 2002 05:40 AM

tshdos,
did you code that hostcache?
i have a question: how can i connect to your
hostcache using my client?
do i just have to enter that url in my client or
how can i manage that?

tshdos May 19th, 2002 09:21 AM

Quote:

did you code that hostcache?
Yes

Quote:

i have a question: how can i connect to your
hostcache using my client?
do i just have to enter that url in my client or
how can i manage that?
I am not sure. I have been looking through the Gnucleus source and I can't find where it actually tries to use a webcache. Try asking in the Gnucleus forum.

tshdos May 19th, 2002 11:55 AM

Small code update
 
1 Attachment(s)
Had to change the line endings and added some checking that should have already been there.

Paradog May 19th, 2002 01:51 PM

tshdos,
lets work together on a asp hostcache ok?
i wanted to code that too but i dont want us
to be 'rivals' (look at those childish flames of bearshare
and limewire). i have asked that guy who coded
that gwebcache for gnucleus:
open gnucleus, go to help and their you can
report the url of your hostcache.
i think they are adding it on their connect1.gnutellanet.com
or something like that.
however, i dont like that indirect method:
i wanted to code a full working visual basic client,
and compile it to a dll so i can use it in asp.
that client should only connect to other, pass them
his known nodes and disconnect.

cultiv8r May 19th, 2002 02:18 PM

ColdFusion GWebCache
 
If anyone is interested, this topic moved me to translate GWebCache from PHP to ColdFusion. It's stable, but requires that you either have CF Pro or Enterprise, not Express, and that CFCONTENT and CFFILE tags are enabled on your host. It can be found at http://www.cultiv8r.com/cultiv8r/gwebcache.

Since CFContent is an issue in my case, I'll be translating it to Delphi as well, to make it an ISAPI DLL and/or regular CGI executable (for Windows environments only though). Any interest in such critter?

-- Mike

Paradog May 19th, 2002 02:25 PM

sure i'm interested cultiv8r! :)
but i dont know cf or delphi, but i heard that
delphi is the same as pascal (which i learned 5 years ago
when i was 10).

by the way,
i have submitted tshdos' hostcache to gnucleus and
its now working....
http://www.uncertaindesign.com/ffsit...spwebcache.asp

cultiv8r May 19th, 2002 02:39 PM

Quote:

but i heard that
delphi is the same as pascal (which i learned 5 years ago
when i was 10).
Yup. A fairly extended version of OOP Pascal, but still the basic syntax. Still able to run Turbo Pascal 3.1 apps without many changes, but who would want that these days *g*.

Quote:

by the way,
i have submitted tshdos' hostcache to gnucleus and
its now working....
http://www.uncertaindesign.com/ffsit...spwebcache.asp
Cool, saw it running. Looks good, fast response too. One thing I'm so eager about GWebCache is that I advocated a similar system not too long ago. There are plenty of user who have a website or home-based webserver that don't mind providing the service of a host cache - but a pure Gnutella-based host cache is a bit overkill for all what it is supposed to do. Hope it catches on well!

-- Mike

Paradog May 19th, 2002 02:45 PM

Quote:

Originally posted by cultiv8r

a pure Gnutella-based host cache is a bit overkill

Do you mean a host cache which is not only caching but connecting directly to other nodes like I said as a pure Gnutella based host cache? I think this would be better because the GWebcache method works only indirectly (you have to report Gnucleus) and although Gnucleus is great - I really hate it to be addicted to anybody. The other method works without Gnucleus too.

cultiv8r May 19th, 2002 03:03 PM

Quote:

Do you mean a host cache which is not only caching but connecting directly to other nodes like I said as a pure Gnutella based host cache? I think this would be better because the GWebcache method works only indirectly (you have to report Gnucleus) and although Gnucleus is great - I really hate it to be addicted to anybody. The other method works without Gnucleus too.
I was more referring to a full-fledged Gnutella client, such as gnutellahosts.com using BearShare for the purpose handing out a few pongs. If you'd like host caches widely spread among more comon users (think in terms of people using websites hosted at an internet provider or at home), such will not succeed. You'll need to have a system that takes up less resources, etc. You can still connect to other host caches, and exchange data, but it shouldn't be as frequent as what we're accustomed to with a true Gnutella client. Another issue, again focusing on the common users, is that Web services are usually limited to HTTP or FTP. If one can fully utilize that, which is something the current GWebCache comes close to, then that's of course excellent. But, it's all a matter of opinion though - I tend to use examples that hit closer to home.

-- Mike

tshdos May 19th, 2002 04:18 PM

I like the idea of an ISAPI extension and was actually starting to write one in C++ after I finished the ASP one.
I was also considering writing a small web server app that would function like the GWebCache but would not be reliant on any web server software.

Quote:

tshdos, lets work together on a asp hostcache ok?
i wanted to code that too but i dont want us
to be 'rivals' (look at those childish flames of bearshare
and limewire).
No problem, I am not trying to compete with anyone. I would just like to see more options all around.

cultiv8r, does the cfcontent tag really remove all the extra whitespace? When I used to use cold fusion, that was one thing that really annoyed me. I think when CF5 came out they finally added an option to eliminate the whitespace but I switched to ASP before I ever had a chance to try it.

cultiv8r May 19th, 2002 04:40 PM

Quote:

cultiv8r, does the cfcontent tag really remove all the extra whitespace? When I used to use cold fusion, that was one thing that really annoyed me. I think when CF5 came out they finally added an option to eliminate the whitespace but I switched to ASP before I ever had a chance to try it.
The problem of leading spaces still exists in CF5, but using the CFCONTENT you can indeed fix that problem now. Just use it like this:

<CFCONTENT type="text/html" reset="YES">

That's why CF version GWebCache needs that tag enabled, otherwise clients that do not expect a leading space will assume there was an error. If the tag is disabled for security issues, there are some other workarounds for that problem but are not elegant. Wish Allaire/Macromedia put in some efforts in fixing that issue, it's been around for quite a while now. Haven't had the chance to try CF MX yet...

-- Mike

Paradog May 21st, 2002 01:58 AM

hey tshdos,
here is my own written hostcache:
www.uncertaindesign.com/ffsite/gnutella/lynn.asp

tshdos May 22nd, 2002 07:10 PM

I just looked at your newest version (0.3). Looks good but I have a couple of suggestions for you.


Line 23:
If Request.Querystring("restart") = 1 Then StartASPEngine '//Change The Default Value


You should probably remove this or add a check for security.


Line 40-47:
If Request.Querystring("url") <> "" Then
UpdateHostCache
Status = "OK"
End If
If Request.Querystring("ip") <> "" Then
UpdateHostCache
Status = "OK"
End If


The way it is setup Request.QueryString("url") is checked up to 4 times and ip is checked up to 3 times. I would suggest changing the behavior of 'UpdateHostCache' to return the status and replace the lines above with:
Status = UpdateHostCache() ' Return "" if no update
Response.Write Status


Line 251-270:
Function IsValidIp


Should add a little more checking. The way it is right now if I sent the ip 0.0.0.0 or 255.255.255.255 or 999.999.999.999 it would pass even though it shouldn't.

Need to block these ips also: 10.*.*.*, 255.255.255.255, 172.16.*.* - 172.31.*.*, 0.0.0.0. ip range 192 should be changed to 192.168.*.*


I did this too but unless you can think of a reason, I see no reason to store the ip and port separately.

Also, just curious but why no locks?

Paradog May 23rd, 2002 02:21 AM

Hi tshdos,
I said in the readme that you should change the
default values due security measures.

No locks,
yeah... I had some problems with it.
I still have no real idea what locks are good for.
during the stress test me iis froze.
then i killed the locks and it worked.

thanks,
paradog

tshdos May 23rd, 2002 06:12 AM

It looks like the reason it froze up is because you have functions that exit without unlocking the application ie:

Function asdf
Application.Lock

If A ="" Then
' should be an application.unlock here
Exit Function
End If

...

Application.Unlock
End Function


The reason for the locks is to keep the counts correct.
An example would be if two clients hit the following line at the same time.
Application("count") = Application("count") + 1
If you assume Application("count") = 0 before they hit this line two things could happen. Either it will work fine and the count will
be 2 or when both clients get the value of count before adding one they both get the value 0 in which case both clients set the count to 1. Honestly if you are not going to get a lot of hits at the same time you don't really have to worry about this, but it doesn't hurt performance if done correctly. You only need to when updating really.

Quote:

I said in the readme that you should change the
default values due security measures.
I did not notice the line said '// Change default values.
But you should probably set the default to something besides 1 since most of the other functions use a 1. Just some advice though.

Paradog May 23rd, 2002 06:43 AM

Thanks,
I really appreciate your help.
Would you like to code Lynn with me together?

If you want you will get access to my ASP Server too.
(Great server: The premium package of www.maximumasp.com)

Do you have ICQ? My number is: 94543674

tshdos May 23rd, 2002 06:49 AM

Sure I will help. I don't need access to your server though. I have a few servers already.

I don't currently have or use ICQ. I might download it later though.

Paradog May 23rd, 2002 07:25 AM

Well, thats cool.
I will try to fix that lock problem,
I dont really know how to validate an ip?
What range do IPs have?
Is it always from 1 to 255?

I searched for tshdos on ICQ and I found one are
you Kevin?

Well it is ok if I add your name on that
temporary homepage of Lynn?

tshdos May 23rd, 2002 07:39 AM

Quote:

I dont really know how to validate an ip?
What range do IPs have?
Is it always from 1 to 255?
For the purposes used here, it is probably easier just to compare the left n chars of the ip against the chars of the ip.
Example:

Public Const IP_MASKS = "127|192.168|(...)"

For Each Mask In Split( IP_MASKS, "|" )
If Left( HostIP, Len( Mask ) ) = Mask ) Then
'block ip
...

IPs range from 0 to 255. I am not sure if it is possible to have a 0 as the first number in an ip but it is ok for the others. I also think 255 might be reserved but I will have to check on that.


Quote:

I searched for tshdos on ICQ and I found one are
you Kevin?
Yes that is me. I have not used it in a year or so. I assumed they would delete it after a while.

Quote:

Well it is ok if I add your name on that
temporary homepage of Lynn?
I have no problem with that.

Paradog May 23rd, 2002 09:51 AM

well see you then.
could you gimme your email address?
mine is guox@gmx.net

tshdos May 23rd, 2002 09:53 AM

kevin@lginetworks.com


All times are GMT -7. The time now is 02:07 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.