Adjusted I2P interface timings

This commit is contained in:
Mark Qvist committed 2022-11-03 16:30:07 +01:00
1 parent 1d2a0fe4c8
commit 01e520b082
2 files changed
+6 -5

No files matched your search

+5 -4
View File
@@ -383,7 +383,7 @@ class I2PInterfacePeer(Interface):
I2P_PROBE_AFTER = 10
I2P_PROBE_INTERVAL = 9
I2P_PROBES = 5
I2P_READ_TIMEOUT = I2P_PROBE_INTERVAL * I2P_PROBES + I2P_PROBE_AFTER
I2P_READ_TIMEOUT = (I2P_PROBE_INTERVAL * I2P_PROBES + I2P_PROBE_AFTER)*2
def __init__(self, parent_interface, owner, name, target_i2p_dest=None, connected_socket=None, max_reconnect_tries=None):
self.rxb = 0
@@ -662,6 +662,8 @@ class I2PInterfacePeer(Interface):
should_run = True
try:
while should_run and not self.wd_reset:
time.sleep(1)
if (time.time()-self.last_write > I2PInterfacePeer.I2P_PROBE_AFTER*0.66):
self.processOutgoing(bytes([0x00]))
@@ -680,7 +682,6 @@ class I2PInterfacePeer(Interface):
should_run = False
time.sleep(1)
finally:
self.wd_reset = False
@@ -709,7 +710,7 @@ class I2PInterfacePeer(Interface):
# Read loop for KISS framing
if (in_frame and byte == KISS.FEND and command == KISS.CMD_DATA):
in_frame = False
if len(data_buffer > RNS.Reticulum.HEADER_MINSIZE+1):
if len(data_buffer) > RNS.Reticulum.HEADER_MINSIZE+1:
self.processIncoming(data_buffer)
elif (byte == KISS.FEND):
in_frame = True
@@ -737,7 +738,7 @@ class I2PInterfacePeer(Interface):
# Read loop for HDLC framing
if (in_frame and byte == HDLC.FLAG):
in_frame = False
if len(data_buffer > RNS.Reticulum.HEADER_MINSIZE+1):
if len(data_buffer) > RNS.Reticulum.HEADER_MINSIZE+1:
self.processIncoming(data_buffer)
elif (byte == HDLC.FLAG):
in_frame = True
+1 -1
View File
@@ -1 +1 @@
Search.setIndex({"docnames": ["examples", "gettingstartedfast", "hardware", "index", "interfaces", "networks", "reference", "support", "understanding", "using", "whatis"], "filenames": ["examples.rst", "gettingstartedfast.rst", "hardware.rst", "index.rst", "interfaces.rst", "networks.rst", "reference.rst", "support.rst", "understanding.rst", "using.rst", "whatis.rst"], "titles": ["Code Examples", "Getting Started Fast", "Communications Hardware", "Reticulum Network Stack Manual", "Supported Interfaces", "Building Networks", "API Reference", "Support Reticulum", "Understanding Reticulum", "Using Reticulum on Your System", "What is Reticulum?"], "terms": {"A": [0, 1, 4, 5, 6, 8, 10], "number": [0, 1, 4, 5, 6, 8, 9], "ar": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10], "includ": [0, 2, 3, 4, 6, 8], "sourc": [0, 1, 2, 5, 8, 10], "distribut": [0, 1, 5, 6, 8, 9], "reticulum": [0, 4, 5, 6], "you": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "can": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "us": [0, 2, 3, 4, 5, 6, 8], "learn": [0, 1, 7, 8], "how": [0, 1, 2, 4, 5, 8, 10], "write": [0, 1, 4, 6, 8], "your": [0, 1, 2, 3, 4, 5, 7, 8, 10], "own": [0, 1, 5, 6, 8, 9, 10], "program": [0, 3, 4, 6, 8, 10], "The": [0, 1, 2, 3, 4, 5, 6, 10], "demonstr": [0, 4], "bare": 0, "minimum": [0, 4, 5, 8], "setup": [0, 1, 3, 4], "requir": [0, 1, 4, 5, 8, 9, 10], "connect": [0, 2, 3, 4, 5, 6, 8, 9, 10], "network": [0, 2, 4, 6, 8, 9, 10], "from": [0, 1, 2, 4, 5, 6, 8, 9, 10], "In": [0, 1, 2, 4, 5, 6, 8, 9, 10], "about": [0, 1, 2, 4, 5, 6, 8], "five": 0, "line": [0, 1, 2, 4, 5, 8, 9, 10], "have": [0, 1, 2, 4, 5, 6, 8, 9], "stack": [0, 1, 5, 6, 8, 9, 10], "initialis": [0, 6, 9], "readi": [0, 1, 2, 4, 5, 6, 10], "pass": [0, 2, 4, 5, 6, 8, 9], "traffic": [0, 1, 4, 5, 6, 8, 9], "thi": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10], "rn": [0, 1, 6, 8, 9], "start": [0, 2, 3, 4, 6, 8, 9], "up": [0, 1, 2, 4, 5, 8, 9, 10], "gener": [0, 1, 2, 4, 5, 6, 8, 9, 10], "new": [0, 4, 5, 6, 8, 9], "destin": [0, 1, 3, 4, 5, 6, 9], "let": [0, 1, 4, 5, 8, 9], "user": [0, 1, 4, 5, 8, 9, 10], "send": [0, 4, 6, 8, 9], "an": [0, 1, 2, 4, 5, 6, 8, 9, 10], "import": [0, 1, 2, 4, 5, 7, 8], "argpars": 0, "": [0, 1, 4, 5, 8, 9, 10], "defin": [0, 4, 8, 9], "app": [0, 1, 6, 8], "name": [0, 3, 4, 5, 6], "we": [0, 1, 2, 4, 7, 8], "ll": [0, 1, 10], "all": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "creat": [0, 3, 4, 5, 6, 8, 9, 10], "sinc": [0, 1, 4, 5, 6, 8], "basic": [0, 1, 3, 6, 9], "i": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "part": [0, 4, 5, 6, 8], "rang": [0, 1, 2, 4, 5, 8, 9, 10], "util": [0, 2, 3, 4, 8], "put": [0, 2, 4], "them": [0, 1, 2, 4, 5, 7, 8, 9, 10], "within": [0, 1, 4, 5, 6, 8], "namespac": 0, "example_util": [0, 9], "app_nam": [0, 6], "execut": [0, 1, 4, 6, 9], "when": [0, 1, 2, 4, 5, 6, 8, 9], "def": 0, "program_setup": 0, "configpath": 0, "must": [0, 1, 4, 5, 6, 8], "first": [0, 1, 4, 6, 8, 9], "randomli": [0, 8], "ident": [0, 1, 3, 6, 9, 10], "our": [0, 8], "just": [0, 1, 2, 4, 5, 8, 10], "endpoint": [0, 5, 6, 8], "address": [0, 1, 4, 5, 6, 8, 10], "commun": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10], "also": [0, 1, 2, 4, 5, 6, 8, 9, 10], "exist": [0, 1, 2, 4, 8, 9, 10], "which": [0, 1, 4, 5, 6, 8, 9], "know": [0, 1, 2, 5, 6, 8, 10], "thei": [0, 1, 4, 5, 6, 8, 9], "reachabl": [0, 1, 4, 5, 6, 8, 9], "autoomat": 0, "path": [0, 1, 2, 4, 6, 8, 9], "anywher": [0, 4], "els": [0, 5, 8], "IN": [0, 6], "singl": [0, 4, 6, 8, 9, 10], "minimalsampl": 0, "configur": [0, 1, 2, 3, 4, 5, 6, 8, 10], "automat": [0, 1, 2, 4, 5, 6, 8, 9, 10], "prove": [0, 8], "packet": [0, 1, 2, 3, 4, 5, 6, 9, 10], "adress": [0, 6, 8], "By": [0, 1, 4, 6, 8, 9], "do": [0, 1, 2, 4, 6, 8, 10], "proof": [0, 6, 8, 9], "each": [0, 1, 4, 5, 8, 9], "incom": [0, 4, 6, 9], "transmit": [0, 4, 8], "back": [0, 4, 8, 10], "sender": [0, 1, 5, 8, 9], "anyon": [0, 1, 2, 5, 6, 8, 9], "tri": 0, "whether": [0, 4, 6, 8], "wa": [0, 2, 4, 5, 6, 8, 10], "receiv": [0, 1, 4, 6, 8, 9], "correctli": 0, "set_proof_strategi": [0, 6], "prove_al": [0, 6], "everyth": [0, 5, 8], "hand": [0, 1], "over": [0, 2, 3, 4, 6, 8, 9, 10], "control": [0, 1, 2, 3, 5, 6, 8, 10], "loop": 0, "announceloop": 0, "log": [0, 4, 9], "prettyhexrep": 0, "hash": [0, 1, 6, 8, 9], "run": [0, 1, 2, 4, 5, 6, 8, 9, 10], "hit": 0, "enter": [0, 9], "manual": [0, 1, 4, 5, 6, 9], "ctrl": 0, "c": [0, 5], "quit": 0, "until": [0, 1, 4, 6], "exit": [0, 1, 6, 9], "If": [0, 1, 2, 4, 5, 6, 8, 9, 10], "server": [0, 1, 2, 3, 9], "client": [0, 1, 2, 3, 6], "messag": [0, 1, 6, 8, 9], "direct": [0, 1, 2, 5, 6, 8, 9], "toward": [0, 4, 8], "while": [0, 1, 2, 4, 5, 6, 8, 10], "true": [0, 4, 6, 9], "input": [0, 9], "sent": [0, 1, 6, 8, 9], "startup": 0, "get": [0, 2, 3, 4, 6, 10], "pars": 0, "desir": [0, 2, 4, 8], "mode": [0, 1, 2, 3, 8, 9, 10], "__name__": 0, "__main__": 0, "try": [0, 3, 4], "parser": 0, "argumentpars": 0, "descript": [0, 9], "add_argu": 0, "config": [0, 1, 2, 5, 9], "action": 0, "store": [0, 2, 8, 9], "default": [0, 1, 2, 4, 5, 6, 8, 9], "none": [0, 4, 6, 8, 9], "help": [0, 2, 5, 7, 8, 9, 10], "altern": [0, 4, 9], "directLine truncated
Search.setIndex({"docnames": ["examples", "gettingstartedfast", "hardware", "index", "interfaces", "networks", "reference", "support", "understanding", "using", "whatis"], "filenames": ["examples.rst", "gettingstartedfast.rst", "hardware.rst", "index.rst", "interfaces.rst", "networks.rst", "reference.rst", "support.rst", "understanding.rst", "using.rst", "whatis.rst"], "titles": ["Code Examples", "Getting Started Fast", "Communications Hardware", "Reticulum Network Stack Manual", "Supported Interfaces", "Building Networks", "API Reference", "Support Reticulum", "Understanding Reticulum", "Using Reticulum on Your System", "What is Reticulum?"], "terms": {"A": [0, 1, 4, 5, 6, 8, 10], "number": [0, 1, 4, 5, 6, 8, 9], "ar": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10], "includ": [0, 2, 3, 4, 6, 8], "sourc": [0, 1, 2, 5, 8, 10], "distribut": [0, 1, 5, 6, 8, 9], "reticulum": [0, 4, 5, 6], "you": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "can": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "us": [0, 2, 3, 4, 5, 6, 8], "learn": [0, 1, 7, 8], "how": [0, 1, 2, 4, 5, 8, 10], "write": [0, 1, 4, 6, 8], "your": [0, 1, 2, 3, 4, 5, 7, 8, 10], "own": [0, 1, 5, 6, 8, 9, 10], "program": [0, 3, 4, 6, 8, 10], "The": [0, 1, 2, 3, 4, 5, 6, 10], "demonstr": [0, 4], "bare": 0, "minimum": [0, 4, 5, 8], "setup": [0, 1, 3, 4], "requir": [0, 1, 4, 5, 8, 9, 10], "connect": [0, 2, 3, 4, 5, 6, 8, 9, 10], "network": [0, 2, 4, 6, 8, 9, 10], "from": [0, 1, 2, 4, 5, 6, 8, 9, 10], "In": [0, 1, 2, 4, 5, 6, 8, 9, 10], "about": [0, 1, 2, 4, 5, 6, 8], "five": 0, "line": [0, 1, 2, 4, 5, 8, 9, 10], "have": [0, 1, 2, 4, 5, 6, 8, 9], "stack": [0, 1, 5, 6, 8, 9, 10], "initialis": [0, 6, 9], "readi": [0, 1, 2, 4, 5, 6, 10], "pass": [0, 2, 4, 5, 6, 8, 9], "traffic": [0, 1, 4, 5, 6, 8, 9], "thi": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10], "rn": [0, 1, 6, 8, 9], "start": [0, 2, 3, 4, 6, 8, 9], "up": [0, 1, 2, 4, 5, 8, 9, 10], "gener": [0, 1, 2, 4, 5, 6, 8, 9, 10], "new": [0, 4, 5, 6, 8, 9], "destin": [0, 1, 3, 4, 5, 6, 9], "let": [0, 1, 4, 5, 8, 9], "user": [0, 1, 4, 5, 8, 9, 10], "send": [0, 4, 6, 8, 9], "an": [0, 1, 2, 4, 5, 6, 8, 9, 10], "import": [0, 1, 2, 4, 5, 7, 8], "argpars": 0, "": [0, 1, 4, 5, 8, 9, 10], "defin": [0, 4, 8, 9], "app": [0, 1, 6, 8], "name": [0, 3, 4, 5, 6], "we": [0, 1, 2, 4, 7, 8], "ll": [0, 1, 10], "all": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "creat": [0, 3, 4, 5, 6, 8, 9, 10], "sinc": [0, 1, 4, 5, 6, 8], "basic": [0, 1, 3, 6, 9], "i": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "part": [0, 4, 5, 6, 8], "rang": [0, 1, 2, 4, 5, 8, 9, 10], "util": [0, 2, 3, 4, 8], "put": [0, 2, 4], "them": [0, 1, 2, 4, 5, 7, 8, 9, 10], "within": [0, 1, 4, 5, 6, 8], "namespac": 0, "example_util": [0, 9], "app_nam": [0, 6], "execut": [0, 1, 4, 6, 9], "when": [0, 1, 2, 4, 5, 6, 8, 9], "def": 0, "program_setup": 0, "configpath": 0, "must": [0, 1, 4, 5, 6, 8], "first": [0, 1, 4, 6, 8, 9], "randomli": [0, 8], "ident": [0, 1, 3, 6, 9, 10], "our": [0, 8], "just": [0, 1, 2, 4, 5, 8, 10], "endpoint": [0, 5, 6, 8], "address": [0, 1, 4, 5, 6, 8, 10], "commun": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10], "also": [0, 1, 2, 4, 5, 6, 8, 9, 10], "exist": [0, 1, 2, 4, 8, 9, 10], "which": [0, 1, 4, 5, 6, 8, 9], "know": [0, 1, 2, 5, 6, 8, 10], "thei": [0, 1, 4, 5, 6, 8, 9], "reachabl": [0, 1, 4, 5, 6, 8, 9], "autoomat": 0, "path": [0, 1, 2, 4, 6, 8, 9], "anywher": [0, 4], "els": [0, 5, 8], "IN": [0, 6], "singl": [0, 4, 6, 8, 9, 10], "minimalsampl": 0, "configur": [0, 1, 2, 3, 4, 5, 6, 8, 10], "automat": [0, 1, 2, 4, 5, 6, 8, 9, 10], "prove": [0, 8], "packet": [0, 1, 2, 3, 4, 5, 6, 9, 10], "adress": [0, 6, 8], "By": [0, 1, 4, 6, 8, 9], "do": [0, 1, 2, 4, 6, 8, 10], "proof": [0, 6, 8, 9], "each": [0, 1, 4, 5, 8, 9], "incom": [0, 4, 6, 9], "transmit": [0, 4, 8], "back": [0, 4, 8, 10], "sender": [0, 1, 5, 8, 9], "anyon": [0, 1, 2, 5, 6, 8, 9], "tri": 0, "whether": [0, 4, 6, 8], "wa": [0, 2, 4, 5, 6, 8, 10], "receiv": [0, 1, 4, 6, 8, 9], "correctli": 0, "set_proof_strategi": [0, 6], "prove_al": [0, 6], "everyth": [0, 5, 8], "hand": [0, 1], "over": [0, 2, 3, 4, 6, 8, 9, 10], "control": [0, 1, 2, 3, 5, 6, 8, 10], "loop": 0, "announceloop": 0, "log": [0, 4, 9], "prettyhexrep": 0, "hash": [0, 1, 6, 8, 9], "run": [0, 1, 2, 4, 5, 6, 8, 9, 10], "hit": 0, "enter": [0, 9], "manual": [0, 1, 4, 5, 6, 9], "ctrl": 0, "c": [0, 5], "quit": 0, "until": [0, 1, 4, 6], "exit": [0, 1, 6, 9], "If": [0, 1, 2, 4, 5, 6, 8, 9, 10], "server": [0, 1, 2, 3, 9], "client": [0, 1, 2, 3, 6], "messag": [0, 1, 6, 8, 9], "direct": [0, 1, 2, 5, 6, 8, 9], "toward": [0, 4, 8], "while": [0, 1, 2, 4, 5, 6, 8, 10], "true": [0, 4, 6, 9], "input": [0, 9], "sent": [0, 1, 6, 8, 9], "startup": 0, "get": [0, 2, 3, 4, 6, 10], "pars": 0, "desir": [0, 2, 4, 8], "mode": [0, 1, 2, 3, 8, 9, 10], "__name__": 0, "__main__": 0, "try": [0, 3, 4], "parser": 0, "argumentpars": 0, "descript": [0, 9], "add_argu": 0, "config": [0, 1, 2, 5, 9], "action": 0, "store": [0, 2, 8, 9], "default": [0, 1, 2, 4, 5, 6, 8, 9], "none": [0, 4, 6, 8, 9], "help": [0, 2, 5, 7, 8, 9, 10], "altern": [0, 4, 9], "directLine truncated