I have a few Emacs servers running on my computer, and a few clients are attached to these servers. Is there a way to get which server a client is attached to from the window?
At a pinch,
(emacs-pid) will give you the server's process ID.
In typical cases, C-hv
server-name is probably going to tell you what you need to know.
For example if you are simply using
emacs --daemon=NAME and connecting with
emacsclient -s NAME, then
server-name will have the value
(expand-file-name server-name server-socket-dir) is more specific, if there's a chance of the socket directory varying.
If you're using TCP sockets instead of local sockets then things are a bit different again, with
server-auth-dir being used.