using sockets from the server to retrieve data