Write pending data after connecting