[glibmm] tests/giomm_tls_client: Put try/catch around Socket::connect().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] tests/giomm_tls_client: Put try/catch around Socket::connect().
- Date: Wed, 3 Dec 2014 10:57:30 +0000 (UTC)
commit 214f3c5bd37a72fb8fa4f163b63e9ac1f40b9aa0
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Dec 3 11:49:37 2014 +0100
tests/giomm_tls_client: Put try/catch around Socket::connect().
Because it's currently timing out for me.
tests/giomm_tls_client/main.cc | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/tests/giomm_tls_client/main.cc b/tests/giomm_tls_client/main.cc
index c76551a..a14fe9f 100644
--- a/tests/giomm_tls_client/main.cc
+++ b/tests/giomm_tls_client/main.cc
@@ -86,7 +86,17 @@ int main(int, char**)
Glib::RefPtr<Gio::InetSocketAddress> address =
Gio::InetSocketAddress::create(first_inet_address, 443);
- socket->connect(address);
+ try
+ {
+ socket->connect(address);
+ }
+ catch(const Gio::Error& ex)
+ {
+ std::cout << "Could not connect socket to " <<
+ address->get_address()->to_string() << ":" << address->get_port() <<
+ ". Exception: " << ex.what() << std::endl;
+ return EXIT_FAILURE;
+ }
if(!socket->is_connected())
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]