MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / onConnect

Method onConnect

lib/AsyncHttpClient/src/AsyncHttpClient.cpp:685–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

683}
684
685void AsyncHttpClient::onConnect()
686{
687 bool isReqOpen = false;
688
689 LOG_INFO("Connected to %s:%u%s.", m_hostname.c_str(), m_port, m_uri.c_str());
690 LOG_DEBUG("Available heap: %u", heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_DEFAULT));
691
692 /* Protect against concurrent access. */
693 {
694 MutexGuard<Mutex> guard(m_mutex);
695
696 m_isConnected = true;
697 isReqOpen = m_isReqOpen;
698 m_isReqOpen = false;
699 }
700
701 /* Is there a queued request, which to send? */
702 if (true == isReqOpen)
703 {
704 if (false == sendRequest())
705 {
706 m_tcpClient.close();
707 }
708 }
709}
710
711void AsyncHttpClient::onDisconnect()
712{

Callers 2

AsyncHttpClientMethod · 0.45
~AsyncHttpClientMethod · 0.45

Calls 2

c_strMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected