Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

QNEthernet higher latency #38

@5b4wn

Description

@5b4wn

First, many thanks for an awesome library!

I would like to report a bug and a possible solution but not sure if this introduces any other issues but this seems to have improved the problem for me..

Describe the bug

When using QNEthernet on a teensy 4.1 websocket server, there seems to be 5-6x latency compared to Native ethernet when sending data
using client.send

Reading https://github.com/ssilverman/QNEthernet#write-immediacy

It seems that the client.write waits for a timeout or enough data to send that adds about 150ms delay for each call

This change in Teensy41_QNEthernet_tcp.hpp seems to correct the problem

void send(const WSString& data) override
{
 client.write(reinterpret_cast<uint8_t*>(const_cast<char*>(data.c_str())), data.size());
 **client.flush();** 
}

void send(const WSString&& data) override
{
 client.write(reinterpret_cast<uint8_t*>(const_cast<char*>(data.c_str())), data.size());
 **client.flush();**
}

void send(const uint8_t* data, const uint32_t len) override
{
 client.write(data, len);
 **client.flush();**
}

BW
Marios

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions