A helper to securely select the correct overload of `connect()` for a generic socket.
| 1450 | // A helper to securely select the correct overload of `connect()` |
| 1451 | // for a generic socket. |
| 1452 | Future<Nothing> connectSocket( |
| 1453 | Socket& socket, |
| 1454 | const Address& address, |
| 1455 | const Option<string>& servername) |
| 1456 | { |
| 1457 | switch (socket.kind()) { |
| 1458 | case SocketImpl::Kind::POLL: |
| 1459 | return socket.connect(address); |
| 1460 | #ifdef USE_SSL_SOCKET |
| 1461 | case SocketImpl::Kind::SSL: |
| 1462 | return socket.connect( |
| 1463 | address, create_tls_client_config(servername)); |
| 1464 | #endif |
| 1465 | } |
| 1466 | |
| 1467 | UNREACHABLE(); |
| 1468 | } |
| 1469 | |
| 1470 | } // namespace internal { |
| 1471 |
no test coverage detected