move gob encoding into a []byte into a function
don't print an error when the local server exits before the local client