|
Methods defined here:
- __del__(self)
- Close the open aDTN socket.
- __init__(self, config)
- aDTN socket.
This will fill the node name, and the RIT path from the configuration
file.
Args:
config (str): Path to the configuration file.
- bind(self, port)
- Bind the socket to the given port.
Args:
port (int): Port to bind the aDTN socket.
Returns:
bool: True if successful, False otherwise.
- recv(self, size=2048)
- Recive a message.
Args:
size (int): Size of the message to recive, default 2048 (Change
only if the entire message is not received)
Returns:
str: The received message.
- recvFrom(self, size=2048)
- Recive a message and the sender info.
Args:
size (int): Size of the message to recive, default 2048 (Change
only if the entire message is not received)
Returns:
(str, adtnSocketAddress): The received message and the sender.
- ritGetValue(self, path)
- Get the value of the given path.
Args:
path (str): Path to get the value.
Returns:
str: Value in the path, or None if not found.
- ritSet(self, path, value)
- Set a value in the RIT.
Args:
path (str): Path for the value.
value (str): Value to save.
Returns:
bool: True if successful, False otherwise.
- ritTag(self, path, tag, value)
- Add a tag with a value to the path in the RIT.
Args:
path (str): Path to add the tag.
tag (str): tag to add.
value (str): value for the tag.
Returns:
bool: True if successful, False otherwise.
- ritUnset(self, path)
- Unset a value in the RIT.
Args:
path (str): Path to unset.
Returns:
bool: True if successful, False otherwise.
- ritUntag(self, path, tag)
- Remoev the tag to the path in the RIT.
Args:
path (str): Path to remove the tag.
tag (str): Name of the tag to remove.
Returns:
bool: True if successful, False otherwise.
- send(self, message, who)
- Send a message to a node.
Args:
message (str): Message to send.
who (adtnSocketAddress): aDTNSocketAddress with the destination.
Returns:
bool: True if successful, False otherwise.
- setCode(self, codeType, code, isFile=False, replace=False)
- Set a Code to the socket.
This code could be a routing code(ROUTING_CODE),
a life code (LIFE_CODE) or a priority code (PRIO_CODE).
The routing code will be executed in each hop of the network to
determine the next hop.
The life code will be executed in each node of the network to decide
if the message is lapsed or not.
The priority code will affect only to the messages in other nodes that
pertain to same application.
Args:
codeType : One value from ROUTING_CODE, LIFE_CODE or PRIO_CODE
code (str): The string containing the code or the path to the code.
isFile (bool): If code is a path this must be set to True.
replace (bool): If a code has been set already, and want to change
it this must be True.
Returns:
bool: True if successful, False otherwise.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|