Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 507d586

Browse filesBrowse files
committed
server: Initialize class member on dynamic alloc
I noticed that server worked on global instance. but not if used in class (allocated with new). This change makes both use working. Forwarded: #17 Relate-to: https://github.com/rzr/webthing-iotjs/wiki/MCU Change-Id: I2e21e34a43f3cadb7981f2e359a5960735daa5d3 Signed-off-by: Philippe Coval <p.coval@samsung.com>
1 parent be067d9 commit 507d586
Copy full SHA for 507d586

File tree

Expand file treeCollapse file tree

2 files changed

+11
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-1
lines changed

‎src/EthernetServer.cpp

Copy file name to clipboardExpand all lines: src/EthernetServer.cpp
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@ extern "C" {
66
#include "EthernetClient.h"
77
#include "EthernetServer.h"
88

9+
EthernetServer::EthernetServer()
10+
{
11+
_port = 80;
12+
_tcp_client[MAX_CLIENT] = {};
13+
_tcp_server = {};
14+
}
15+
916
EthernetServer::EthernetServer(uint16_t port)
1017
{
1118
_port = port;
19+
_tcp_client[MAX_CLIENT] = {};
20+
_tcp_server = {};
1221
}
1322

1423
void EthernetServer::begin()

‎src/EthernetServer.h

Copy file name to clipboardExpand all lines: src/EthernetServer.h
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public Server {
1414

1515
void accept(void);
1616
public:
17-
EthernetServer(uint16_t);
17+
EthernetServer();
18+
EthernetServer(uint16_t port);
1819
EthernetClient available();
1920
virtual void begin();
2021
virtual size_t write(uint8_t);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.