GameCenter can have APIs to do this. Other than this, this is a standard network question. If the devices are on the same LAN, they can speak peer-to-peer. Otherwise, the devices will have a difficult time connecting behind a NAT.
Edit: This StackOverflow thread discusses the GameCenter page.