PeerToPeer
Object Hierarchy:
Description:
public class PeerToPeer :
RPCDispatcher,
IPeerToPeer
This is the class that must be inherited to create a Strict PeerToPeer module service. A strict service is a service where all the hosts
connected to Netsukuku are participant, so the MapPeerToPeer is not used here.
Namespace: Ntk.Core
Package: Netsukuku - vala port
Content:
Creation methods:
Methods:
- public virtual void start_operations ()
Called after peer_to_peer_hook. Overridable (eg in
OptionalPeerToPeer)
- public virtual void stop_operations ()
Called when address is dying. Overridable (eg in OptionalPeerToPeer)
- public virtual
bool
is_participant (int
lvl, int
pos)
Returns True iff the node lvl,pos is participating to the service.
For a "strict PeerToPeer" it means iff the node exists in maproute. An inheriting class could override the function.
- public virtual NIP h (
Object
key)
This is the function h:KEY-->hIP.
- public
List
<AggregatedNeighbour> neighbours_get_from_lvl_pos (int
lvl, int
pos)
Returns the AggregatedNeighbour instances of the neighbours we can
use to reach the hash node, in order of efficiency.
- public
List
<int
> list_ids (int
center, int
sign)
- public HCoord? search_participant (NIP hIP,
int
path_sign = 1) throws PeerToPeerError
Returns the destination in hierarchical coordinates of the best
approximation of the passed NIP as a participant to the service. Returns null iff it's me.
- public PartialNIP search_participant_as_nip (NIP hIP,
int
path_sign = 1) throws PeerToPeerError
- public ISerializable msg_send (NIP sender_nip, NIP hip, RemoteCall data) throws
Error
Start a tentative to send a message to a certain perfect hip
- public ISerializable msg_deliver (PeerToPeerTracerPacketList peer_to_peer_tpl, NIP sender_nip, NIP hip, RemoteCall data) throws
Error
Delivers a msg to the nearest to hip
- public ISerializable msg_exec (NIP sender_nip, RemoteCall data) throws
Error
Execution of a msg
- public
List
<NIP> find_nearest_to_register (NIP hash_nip, int
num_dupl, int
? inside_gnode_level = null) throws RPCError
Search functions for registration with replica. Routed.
- public
List
<NIP> find_nearest (PeerToPeerTracerPacketList peer_to_peer_tpl, NIP hash_nip, int
num_dupl, int
lvl, int
pos) throws RPCError
- public
List
<NIP> inside_find_nearest (PeerToPeerTracerPacketList peer_to_peer_tpl, NIP hash_nip, int
num_dupl, int
lvl, int
pos) throws RPCError
- public
int
get_number_of_participants (int
lvl, int
pos, int
timeout) throws RPCError
Search functions for hooking phase. Routed.
- public
int
number_of_participants (PeerToPeerTracerPacketList peer_to_peer_tpl, int
lvl, int
pos) throws RPCError
- public
int
inside_number_of_participants (PeerToPeerTracerPacketList peer_to_peer_tpl, int
lvl, int
pos) throws RPCError
- public void find_hook_peers (out NIP? ret_nip_to_reach_first_forward, out NIP? ret_nip_to_reach_first_back, out NIP? ret_nip_to_reach_last_back,
int
lvl, int
num_dupl, int
timeout = 120000)
Helper functions for hooking phase.
- public
bool
is_x_after_me_for_y (NIP x, NIP y)
y is the perfect nip for a particular key. If someone asks for y,
will he hit me before x?
Signals:
Fields: