MCPcopy Create free account
hub / github.com/SmingHub/Sming / internalConnect

Method internalConnect

Sming/Components/Network/src/Network/TcpConnection.cpp:385–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385bool 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
403err_t TcpConnection::internalOnConnected(err_t err)
404{

Callers

nothing calls this directly

Calls 2

internalOnConnectedMethod · 0.80
FixNetworkRoutingFunction · 0.70

Tested by

no test coverage detected