Skip to content

Commit

Permalink
fix(stdlib): do not try to open a new tcp connection in tethering-ine…
Browse files Browse the repository at this point in the history
…t while it has already opened connection
  • Loading branch information
brusherru committed Jun 19, 2020
1 parent 63a47a6 commit 219395c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions workspace/__lib__/xod/debug/open-tcp/patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ void evaluate(Context ctx) {
return;

auto inet = getValue<input_INET>(ctx);

// Do nothing if TCP connection is already opened
if (inet->isConnected()) return;

auto host = getValue<input_HOST>(ctx);
uint32_t port = (uint32_t)getValue<input_PORT>(ctx);

Expand Down
2 changes: 2 additions & 0 deletions workspace/__lib__/xod/debug/tethering-inet/patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ class TetheringInternet {
// TODO: MUX
printPrefix();
writeCmd(CIPCLOSE, EOL);
_connected = false;
_pkgSize = 0;
return readCmd(OK, ERROR) == 1;
}
};
Expand Down

0 comments on commit 219395c

Please sign in to comment.