peer.c: has both server and client