basic version of socket communication