client-server sockets
merged from whatever