| 383 | } |
| 384 | |
| 385 | bool TcpConnection::internalConnect(IpAddress addr, uint16_t port) |
| 386 | { |
| 387 | NetUtils::FixNetworkRouting(); |
| 388 | err_t res = tcp_connect(tcp, addr, port, [](void* arg, tcp_pcb* tcp, err_t err) -> err_t { |
| 389 | auto con = static_cast<TcpConnection*>(arg); |
| 390 | if(con == nullptr) { |
| 391 | debug_d("TCP connect ABORT"); |
| 392 | //closeTcpConnection(tcp); |
| 393 | tcp_abort(tcp); |
| 394 | return ERR_ABRT; |
| 395 | } else { |
| 396 | return con->internalOnConnected(err); |
| 397 | } |
| 398 | }); |
| 399 | debug_d("TCP connect result: %d", res); |
| 400 | return res == ERR_OK; |
| 401 | } |
| 402 | |
| 403 | err_t TcpConnection::internalOnConnected(err_t err) |
| 404 | { |
nothing calls this directly
no test coverage detected