i don't even know anymore
This commit is contained in:
@@ -198,4 +198,21 @@ class Net {
|
||||
public function removeProto(proto:String) {
|
||||
protoHandlers.remove(proto);
|
||||
}
|
||||
|
||||
/**
|
||||
Sends a ping package to the given id. Returns true if there was a response.
|
||||
**/
|
||||
public function ping(toID: NetworkID): Promise<Bool> {
|
||||
return new Promise<Bool>((resolve,reject)->{
|
||||
this.sendAndAwait(toID,"ping",null).map(pack -> {
|
||||
switch pack {
|
||||
case Success(_):
|
||||
resolve(true);
|
||||
case Failure(err):
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
return null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,4 +176,8 @@ class Routing {
|
||||
return {interf: route.interf,rep: route.rep};
|
||||
}
|
||||
}
|
||||
|
||||
public function getRouteTable():Map<NetworkID, Route> {
|
||||
return this.routingTable;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user