partly redesigned server/client/socket