MCPcopy Create free account
hub / github.com/defold/defold / Connect

Method Connect

engine/dlib/src/dlib/http_client.cpp:211–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209 };
210
211 Result Response::Connect(const char* host, uint16_t port, bool secure, int timeout, int* canceled)
212 {
213 m_Pool = g_PoolCreator.GetPool();
214 dmConnectionPool::Result r = dmConnectionPool::Dial(m_Pool, host, port, secure, timeout, canceled, &m_Connection, &m_Client->m_SocketResult);
215
216 if (r == dmConnectionPool::RESULT_OK) {
217
218 m_Socket = dmConnectionPool::GetSocket(m_Pool, m_Connection);
219 m_SSLSocket = dmConnectionPool::GetSSLSocket(m_Pool, m_Connection);
220
221 dmSocket::SetSendTimeout(m_Socket, SOCKET_TIMEOUT);
222 dmSocket::SetReceiveTimeout(m_Socket, SOCKET_TIMEOUT);
223
224 return RESULT_OK;
225 } else {
226 return RESULT_SOCKET_ERROR;
227 }
228 }
229
230 Result Response::CreateSSLSocket(const char* host, int timeout)
231 {

Callers 2

DoRequestFunction · 0.80
AutoConnectFunction · 0.80

Calls 6

DialFunction · 0.85
GetSSLSocketFunction · 0.85
GetPoolMethod · 0.80
GetSocketFunction · 0.70
SetSendTimeoutFunction · 0.70
SetReceiveTimeoutFunction · 0.70

Tested by

no test coverage detected