check the length to see if socket was closed