File tree 1 file changed +10
-11
lines changed
1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -156,17 +156,16 @@ bool gatewayTransportSend(MyMessage &message)
156
156
#else
157
157
EthernetClient client;
158
158
#if defined(MY_CONTROLLER_URL_ADDRESS)
159
- if (client.connect (MY_CONTROLLER_URL_ADDRESS, MY_PORT)) {
160
- #else
161
- if (client.connect (_ethernetControllerIP, MY_PORT)) {
162
- #endif
163
- client.write (_ethernetMsg, strlen (_ethernetMsg));
164
- client.stop ();
165
- }
166
- else {
167
- // connecting to the server failed!
168
- ret = false ;
169
- }
159
+ if (client.connected () || client.connect (MY_CONTROLLER_URL_ADDRESS, MY_PORT)) {
160
+ #else
161
+ if (client.connected () || client.connect (_ethernetControllerIP, MY_PORT)) {
162
+ #endif
163
+ client.write (_ethernetMsg, strlen (_ethernetMsg));
164
+ }
165
+ else {
166
+ // connecting to the server failed!
167
+ ret = false ;
168
+ }
170
169
#endif
171
170
#else
172
171
// Send message to connected clients
You can’t perform that action at this time.
0 commit comments