wrapped drain call, changed back to encodePacket, moved intervalCleanup to WS, ...