client code that prints server packets to file