title: iOs in app chat
body: <p>So I have an app that includes peer to peer chat, which is only between two users at a time.  What I am doing now is upon the user typing a new message, it calls a PHP script which inserts the message into a mysql table.  then every 5 seconds the code calls a php script which downloads all the messages.  So there is a maximum 10 second gap between messages.  So my question is if there is a better way to do peer to peer chat.</p>