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

Function Connect

engine/dlib/src/dlib/connection_pool.cpp:424–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422 }
423
424 static Result Connect(HPool pool, Connection* connection, const char* host, dmSocket::Address address, uint16_t port, int timeout,
425 dmSocket::Socket* socket, dmSocket::Result* sr)
426 {
427 uint64_t connectstart = dmTime::GetMonotonicTime();
428
429 Result r = ConnectSocket(pool, connection, address, port, timeout, socket, sr);
430 if( r != RESULT_OK )
431 {
432 *socket = dmSocket::INVALID_SOCKET_HANDLE;
433 return r;
434 }
435
436 uint64_t now = dmTime::GetMonotonicTime();
437 if( timeout > 0 && (now - connectstart) > (uint64_t)timeout )
438 {
439 CloseInProgressSocket(pool, connection, socket);
440 return RESULT_SOCKET_ERROR;
441 }
442 return r;
443 }
444
445 Result DoDial(HPool pool, const char* host, uint16_t port, bool ssl, int timeout, int* cancelflag, HConnection* connection, dmSocket::Result* sock_res, bool ipv4, bool ipv6)
446 {

Callers 2

ConnectSocketFunction · 0.70
DoDialFunction · 0.70

Calls 3

ConnectSocketFunction · 0.85
CloseInProgressSocketFunction · 0.85
GetMonotonicTimeFunction · 0.70

Tested by

no test coverage detected