debugging reading sockets