![]() |
GWebCache 1.0.0-alpha
C# library and nuget package to interact with a Gnutella Webcache
|
Client for interacting with a GWebCache server. Supports Version 1 and 2 of the protocol. More...
Public Member Functions | |
bool | CheckIfAlive () |
Preforms a ping request to the server to check if it is alive. | |
bool | WebCacheIsV2 () |
Returns the property GWebCacheClientConfig.IsV2 | |
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? network=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< 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! | |
Result< UpdateResponse > | Update (UpdateRequest updateRequest) |
Sends an Update request to the webcache. Indicating a new gnutella node, or webcache url or both. | |
bool GWebCache.IGWebCacheClient.CheckIfAlive | ( | ) |
Preforms a ping request to the server to check if it is alive.
A succesfull pong response is defined in PongResponse
Implemented in GWebCache.GWebCacheClient.
Result< GetResponse > GWebCache.IGWebCacheClient.Get | ( | GnutellaNetwork? | network | ) |
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
Implemented in GWebCache.GWebCacheClient.
Result< HostfileResponse > GWebCache.IGWebCacheClient.GetHostfile | ( | GnutellaNetwork? | network = null | ) |
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>
Implemented in GWebCache.GWebCacheClient.
Result< StatFileResponse > GWebCache.IGWebCacheClient.GetStats | ( | ) |
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>
Implemented in GWebCache.GWebCacheClient.
Result< UrlFileResponse > GWebCache.IGWebCacheClient.GetUrlFile | ( | GnutellaNetwork? | network = null | ) |
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
Implemented in GWebCache.GWebCacheClient.
Result< PongResponse > GWebCache.IGWebCacheClient.Ping | ( | ) |
Preforms a ping request to the webcache. Mainly used to check if the server is alive.
Result<T>
Implemented in GWebCache.GWebCacheClient.
Result< UpdateResponse > GWebCache.IGWebCacheClient.Update | ( | UpdateRequest | updateRequest | ) |
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"/>
Implemented in GWebCache.GWebCacheClient.
bool GWebCache.IGWebCacheClient.WebCacheIsV2 | ( | ) |
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.
Implemented in GWebCache.GWebCacheClient.