copied into code from web
learn to make a small server and client using socket