Skip to content

EthernetClient::write returns wrong value when buffer size exceeds W5100.SSIZE #141

Open
@rayshobby

Description

@rayshobby

The return value of EthernetClient::write should be the return value of Ethernet::socketSend:

if (Ethernet.socketSend(sockindex, buf, size)) return size;

Otherwise if the buffer to be sent is larger than W5100.SSIZE it will only send W5100.SSIZE number of characters,
https://github.com/arduino-libraries/Ethernet/blob/master/src/socket.cpp#L428
yet EthernetClient::write still returns 'size'.

A better way to implement EthernetClient::write is to add a loop until the whole content is sent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions