add blocking fun to wait until sending most packet