mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-07-26 09:38:14 -07:00
RNode TCP connection on Android
This commit is contained in:
@@ -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:]
|
||||||
|
|||||||
Reference in New Issue
Block a user