Do network operations complete if you tap the lock button?
The button on top is not a power button.  It's a lock button which informs the OS to turn off the display to save power and to prevent accidental touch input, but the rest of the device keeps running.  Apps continue to run for a short while after the display and touchscreen is powered off, from a few seconds for most apps, to several minutes, and even longer for a few specific types of apps, such as background music players and VOIP apps under iOS 4 and newer.  Some GPS logging apps can also continue to run in the background as well.

Some newer networking apps request a few minute to complete operations in the background, but not all older apps could or did.  So it depends on the iOS version, the particular app and version of that app.