Skip to content

Remote IP on EthernetClient #5234

Closed
Closed
@DarioDaF

Description

@DarioDaF

I sudgest adding a function to read the IP of the Clients

Changes needed:

EthernetClient.h

class EthernetClient : public Client {

public:

  virtual uint8_t remoteIP(uint8_t *buf); // Change

};

EthernetClient.cpp

uint8_t EthernetClient::remoteIP(uint8_t *buf) {
  if (_sock != MAX_SOCK_NUM)
    return W5100.readSnDIPR(_sock, buf);
  return 0;
}

It is a simple and usefull change in the library that can be used to retrive the IP address of a client connected to the EthernetServer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Library: EthernetThe Ethernet Arduino libraryfeature requestA request to make an enhancement (not a bug fix)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions