samples/iostream: Produce proper begin/end message