Does this happen when the printer is directly connected to a PC. I presume it doesn't.
I would probably contact the printer MFR and ask them if there is a reason why the connection drops when the printer goes to sleep. If the printer is sleeping and for some reason cutting off the connection to any devices it's connected to, there could be a problem there at the printer. Printers usually don't shut off the USB or LAN connections. They need to be waiting for singles of print jobs coming down the line to print. Something isn't keeping the connection alive.