Maritime slang for being bent over a cannon and whacked with a cane. This was a common punishment in the British Royal Navy for a while.

Other sources suggests that the punishment is to tied to the barrel of a cannon while it is fired four or five times. This seems rather impractical, since you'd be wasting a lot of ammunition. Unless of course it was done during an actual battle, but that seems rather awkward as well.