Skip to content

feat: Add function to define port of EthernetServer at runtime #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/EthernetServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ void EthernetServer::begin()
tcp_accept(_tcp_server.pcb, tcp_accept_callback);
}

void EthernetServer::begin(uint16_t port)
{
_port = port;
begin();
}

void EthernetServer::accept()
{
/* Free client if disconnected */
Expand Down
1 change: 1 addition & 0 deletions src/EthernetServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class EthernetServer :
EthernetServer(uint16_t port = 80);
EthernetClient available();
virtual void begin();
virtual void begin(uint16_t port);
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
using Print::write;
Expand Down