Reworked framed socket to handle fragmented headers