Re: Gio::SocketConnection to Gio::TlsClientConnection



Am 2015-02-07 00:39, schrieb mohgtkmm dadygtkmm:
Hi
might the following help you:
https://developer.gnome.org/glibmm/stable/classGio_1_1TlsClientConnection.html

Good luck!


I knew this already, but I'm missing some part to get back to the SocketConnection.

But I think I get it to work now...

Glib::RefPtr<Gio::SocketConnection> m_p_connection = ...;
Glib::RefPtr<Gio::IOStream> p_basestream = Glib::RefPtr<Gio::IOStream>::cast_dynamic(m_p_connection); Glib::RefPtr<Gio::TlsClientConnection> p_tlsconn = Gio::TlsClientConnection::create(p_basestream);

For starting the TLS communication you have to call:

p_tlsconn->handshake();
Glib::RefPtr<Gio::IOStream> p_tlsstream = Glib::RefPtr<Gio::IOStream>::cast_dynamic(p_tlsconn); m_p_connection = Glib::wrap(g_tcp_wrapper_connection_new(p_tlsstream->gobj(), m_p_connection->get_socket()->gobj()));

You see what I am missing in giomm and is replaced now with a Glib::wrap.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]