mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-07-23 23:11:18 -04:00
Added support for dynamic link MTU to Channel and Buffer
This commit is contained in:
parent
93330d96a0
commit
bde33e7d84
3 changed files with 11 additions and 6 deletions
|
@ -45,7 +45,8 @@ class StreamDataMessage(MessageBase):
|
|||
The stream id is limited to 2 bytes - 2 bit
|
||||
"""
|
||||
|
||||
MAX_DATA_LEN = RNS.Link.MDU - 2 - 6 # 2 for stream data message header, 6 for channel envelope
|
||||
OVERHEAD = 2 + 6 # 2 for stream data message header, 6 for channel envelope
|
||||
MAX_DATA_LEN = RNS.Link.MDU - OVERHEAD
|
||||
"""
|
||||
When the Buffer package is imported, this value is
|
||||
calculcated based on the value of OVERHEAD
|
||||
|
@ -215,6 +216,7 @@ class RawChannelWriter(RawIOBase, AbstractContextManager):
|
|||
self._stream_id = stream_id
|
||||
self._channel = channel
|
||||
self._eof = False
|
||||
self._mdu = channel.mdu - StreamDataMessage.OVERHEAD
|
||||
|
||||
def write(self, __b: bytes) -> int | None:
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue