An iPhone app, connecting to a remote server via TCP. The use scenarios are:
For when the app is in the foreground:
Look at STOMP http://stomp.codehaus.org/Protocol
The STOMP Framework in Obj-C http://code.google.com/p/stompframework/
and the ActiveMQ broker http://activemq.apache.org/
For when the app is in the background I would probably go for using APNS (Notifications) to prompt the user to wake the app back up...