Return stuff and close sockets