| 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 | { |
no test coverage detected