Try adding this after the sockread %data
Code:
    
while ($sockbr) {
      sockread %data
    }

and this event
Code:
on *:sockclose:followed: {
    var %data
    sockread -f %data
echo -a %data
}

And check if it echoes the line you want smile