There is apparently a bug in the Gtk libraries used by the default emacs binary in Ubuntu.
If you use the lucid variant (eg emacs23-lucid
) then things do indeed work swimmingly. I connect, drop, reconnect, ... hundreds of times between reboots.
I re-connect either in text mode, or x11 mode, and set up simple aliases for this:
alias emt='TERM=vt100 emacsclient -nw'
alias emx='emacsclient -c'