mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-12-18 01:44:50 -05:00
RNode TCP connection on Android
This commit is contained in:
parent
7c99aca1d0
commit
fcdcf1a2a8
1 changed files with 3 additions and 2 deletions
|
|
@ -32,6 +32,7 @@ from RNS.Interfaces.Interface import Interface
|
||||||
from time import sleep
|
from time import sleep
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
import socket
|
||||||
import time
|
import time
|
||||||
import math
|
import math
|
||||||
import RNS
|
import RNS
|
||||||
|
|
@ -1501,7 +1502,7 @@ class RNodeInterface(Interface):
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.online = False
|
self.online = False
|
||||||
RNS.log("A serial port occurred, the contained exception was: "+str(e), RNS.LOG_ERROR)
|
RNS.log("A serial port error occurred, the contained exception was: "+str(e), RNS.LOG_ERROR)
|
||||||
RNS.log("The interface "+str(self)+" experienced an unrecoverable error and is now offline.", RNS.LOG_ERROR)
|
RNS.log("The interface "+str(self)+" experienced an unrecoverable error and is now offline.", RNS.LOG_ERROR)
|
||||||
|
|
||||||
if RNS.Reticulum.panic_on_interface_error:
|
if RNS.Reticulum.panic_on_interface_error:
|
||||||
|
|
@ -1898,7 +1899,7 @@ class TCPConnection():
|
||||||
|
|
||||||
return len(data_bytes)
|
return len(data_bytes)
|
||||||
|
|
||||||
def read(self, n):
|
def read(self, n=4096):
|
||||||
with self.owner.tcp_rx_lock:
|
with self.owner.tcp_rx_lock:
|
||||||
data = self.owner.tcp_rx_queue[:n]
|
data = self.owner.tcp_rx_queue[:n]
|
||||||
self.owner.tcp_rx_queue = self.owner.tcp_rx_queue[n:]
|
self.owner.tcp_rx_queue = self.owner.tcp_rx_queue[n:]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue