LinuxSampler can be remotely shutdown by provoking broken pipe error. This can be done by reading the returned data from LinuxSampler partially. I'm sending example code which works most of the time. I'm not sending patch because I'm not sure what will be the right decision for this problem. It looks like the problem rises in LSCPServer::AnswerClient method.
Created attachment 8 [details] shutdown.c example
It looks like that LinuxSampler exits when 'Broken pipe' error is provoked because by default send function sends SIGPIPE 'on errors on stream oriented sockets when the other end breaks the connection'. The easiest solution will be to use MSG_NOSIGNAL flag. Sending patch for lscpserver.cpp
Created attachment 9 [details] patch for lscpserver.cpp
Looks ok from my side. Go ahead and commit it! You have write access on the LS CVS module as well. Please read http://cvs.linuxsampler.org/developers.html if you haven't done already. That's a short readme for new developers.
Fixed