I’m currently writing a few tests in python regarding a tcp server of mine. I want to test behaviour when a message is split in multiple different packages. How can I force the OS to actually send the message and not wait for more data to avoid sending small packages? Just waiting time.sleep
is not an option.
def send(self, msg: Union[str,List[str]]):
if isinstance(msg, list):
for m in msg:
self.s.sendall(m.encode())
else:
self.s.sendall(msg.encode())