Don't close the socket before the coroutine shut down
Don't close the socket before the coroutine shut down

The connection shutdown needs the socket intact:

7  0xb6d38cdf in vnc_connection_tls_push (transport=0x8d84108, data=0x8df33c0, len=229) at vncconnection.c:942
8  0xb6b30437 in ?? () from /usr/lib/libgnutls.so.26
9  0xb6b2d12c in _gnutls_send_int () from /usr/lib/libgnutls.so.26
10 0xb6b4d682 in gnutls_alert_send () from /usr/lib/libgnutls.so.26
11 0xb6b2d662 in gnutls_bye () from /usr/lib/libgnutls.so.26
12 0xb6d3a620 in vnc_connection_close (conn=0x8d84108) at vncconnection.c:4323

so close the socket after the coroutine shutdown. Otherwise it fills the
console with:

(gvncviewer:11056): GLib-GIO-CRITICAL **: g_socket_send: assertion `G_IS_SOCKET (socket) && buffer != NULL' failed

and gets stuck in an endless loop.

jwendell/gtk-vnc,jwendell/gtk-vnc,jwendell/gtk-vnc,jwendell/gtk-vnc,jwendell/gtk-vnc