GWebCache 1.0.0-alpha
C# library and nuget package to interact with a Gnutella Webcache
Loading...
Searching...
No Matches
GWebCache.Models.GnutellaNode Class Reference

The model representing a Gnutella node on the network stored in the cache. More...

Public Member Functions

 GnutellaNode (string ipAddress, int port)
 Constructs a new Gnutella Node.
 
 GnutellaNode (IPAddress IPAddress, int port)
 Constructs a new Gnutella Node.
 
override string ToString ()
 Returns the node as ip:port and url encodes it.
 
override bool Equals (object? obj)
 Two nodes are equal if their ips are the same and their ports are the same.
 
override int GetHashCode ()
 Not relevant since the Equals method doesn't need it.
 

Properties

IPAddress IPAddress [get, set]
 The ip adress of the node.
 
int Port [get, set]
 Listening port of the node.
 
TimeSpan ActiveSince [get, set]
 When did the webcache get an update about this node.
 

Detailed Description

The model representing a Gnutella node on the network stored in the cache.

Constructor & Destructor Documentation

◆ GnutellaNode() [1/2]

GWebCache.Models.GnutellaNode.GnutellaNode ( string ipAddress,
int port )
inline

Constructs a new Gnutella Node.

Parameters
ipAddressstring representation of the IP
portListening port of the node
Exceptions
ArgumentExceptionIf the ipadress is not valid or the port number is below zero

◆ GnutellaNode() [2/2]

GWebCache.Models.GnutellaNode.GnutellaNode ( IPAddress IPAddress,
int port )
inline

Constructs a new Gnutella Node.

Parameters
ipAddressIPaddress of the node
portListening port of the node
Exceptions
ArgumentExceptionIf the port number is below zero

Member Function Documentation

◆ Equals()

override bool GWebCache.Models.GnutellaNode.Equals ( object? obj)
inline

Two nodes are equal if their ips are the same and their ports are the same.

Returns
An indication if two nodes are equal

◆ GetHashCode()

override int GWebCache.Models.GnutellaNode.GetHashCode ( )
inline

Not relevant since the Equals method doesn't need it.

Exceptions
NotImplementedException

◆ ToString()

override string GWebCache.Models.GnutellaNode.ToString ( )
inline

Returns the node as ip:port and url encodes it.

The reason for the url encoding is that we can then immeaditely send it on to the webcache

Property Documentation

◆ ActiveSince

TimeSpan GWebCache.Models.GnutellaNode.ActiveSince
getset

When did the webcache get an update about this node.

This is exclusively provided by V2 webcaches so always check if this is not filled in


The documentation for this class was generated from the following file: