![]() |
GWebCache 1.0.0-alpha
C# library and nuget package to interact with a Gnutella Webcache
|
Concrete implementation of IGWebCacheClient More...
Public Member Functions | |
GWebCacheClient (string host, GWebCacheClientConfig? config=null) | |
Constructor for the GWebCacheClient. | |
bool | CheckIfAlive () |
Preforms a ping request to the server to check if it is alive. | |
Result< PongResponse > | Ping () |
Preforms a ping request to the webcache. Mainly used to check if the server is alive. | |
Result< StatFileResponse > | GetStats () |
Returns the stats of the webcache server. | |
Result< HostfileResponse > | GetHostfile (GnutellaNetwork? gnutellaNetwork=null) |
Retrieves a list of Gnutella Nodes from the webcache. | |
Result< UrlFileResponse > | GetUrlFile (GnutellaNetwork? network=null) |
Retrieves a list of Urls to other webcaches from the webcache. | |
Result< UpdateResponse > | Update (UpdateRequest updateRequest) |
Sends an Update request to the webcache. Indicating a new gnutella node, or webcache url or both. | |
Result< GetResponse > | Get (GnutellaNetwork? network) |
Retrieves a list of Gnutella Nodes and webcache urls from a V2 webache. This is only valid on a V2 cache! | |
bool | WebCacheIsV2 () |
Returns the property GWebCacheClientConfig.IsV2 | |
Concrete implementation of IGWebCacheClient
|
inline |
Constructor for the GWebCacheClient.
host | The url of the webcache in string format |
config | Optional configuration object |
ArgumentException | If the url can't be parsed an argument exception is thrown |
It's recommended that you use http even if the webcache supports https.
The constructor will invoke the default configuration if not specified GWebCacheClientConfig
The constructor will also check if the webcache is a V2 webcache in case it's not explicitely provided in the configuration
DetermineIfCacheIsV2
|
inline |
Preforms a ping request to the server to check if it is alive.
A succesfull pong response is defined in PongResponse
Implements GWebCache.IGWebCacheClient.
|
inline |
Retrieves a list of Gnutella Nodes and webcache urls from a V2 webache. This is only valid on a V2 cache!
network | The network you want to get the nodes and webcache urls from. |
GetResponse
Implements GWebCache.IGWebCacheClient.
|
inline |
Retrieves a list of Gnutella Nodes from the webcache.
network | The network you want to get the nodes from. Will not be specified by default. |
V1 caches typically don't include gnutella 2 or the network parameter. However they will ignore it so it's always best to specify.
You can use this method on both versions. It is however recommended to use the Get(GnutellaNetwork?) method for version 2 of the specification.
<example
Result<T>
Implements GWebCache.IGWebCacheClient.
|
inline |
Returns the stats of the webcache server.
Not all webcache servers actually implement this. So don't assume you will get a successfull result.
Result<T>
Implements GWebCache.IGWebCacheClient.
|
inline |
Retrieves a list of Urls to other webcaches from the webcache.
network | The network you want to get the nodes from. Will not be specified by default. |
While the network parameter doesn't make a difference in V2 caches a lot of them require it and will return the same result regardless.
UrlFileResponse
Implements GWebCache.IGWebCacheClient.
|
inline |
Preforms a ping request to the webcache. Mainly used to check if the server is alive.
Result<T>
Implements GWebCache.IGWebCacheClient.
|
inline |
Sends an Update request to the webcache. Indicating a new gnutella node, or webcache url or both.
Note that there's a network parameter in the update request.
The update response might also contain warnings when for example you're being rate limited.
UpdateResponse" <seealso cref="Result{T}"/> <seealso cref="UpdateRequest"/> <seealso cref="GnutellaNode"/> <seealso cref="GWebCacheNode"/>
Implements GWebCache.IGWebCacheClient.
|
inline |
Returns the property GWebCacheClientConfig.IsV2
If this property wasn't specified, a ping request is made when creating the client to fill in this property.
Implements GWebCache.IGWebCacheClient.