update packet writer onSend