buffer multiple writes, to avoid sending multiple tcp packets for small messages