Skip to content

Commit

Permalink
Debug the client connect
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussy committed Feb 25, 2020
1 parent 5195103 commit cb2dd39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pushtarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ bool pushTarget(PushTarget *target) {
String json;
serializeJson(doc, json);

IPAddress targetIP = target->ip;
int port = lcburl.getPort();
// Use the IP address we resolved if we are connecting with mDNS
Log.verbose(F("Connecting to: %s @ %s on port %l" CR),
lcburl.getHost().c_str(),
target->ip.toString().c_str(),
lcburl.getPort()
targetIP.toString().c_str(),
port
);

WiFiClient client;
Expand All @@ -75,8 +77,6 @@ bool pushTarget(PushTarget *target) {
// -2 = INVALID_SERVER
// -3 = TRUNCATED
// -4 = INVALID_RESPONSE
IPAddress targetIP = target->ip;
int port = lcburl.getPort();
if (client.connect(targetIP, port)) {
Log.notice(F("Connected to: %s at %s, %l" CR),
target->target.name, lcburl.getHost().c_str(), port
Expand Down

0 comments on commit cb2dd39

Please sign in to comment.