rename client and server to main and sub process, attach $stdin to EM