1

I have to do a simple iPhone project as part of an university exam which consists in creating a simple instant messenger based on a client/server system using the Java Servlet technology (required).

What I would like to know is if there is a framework or some simple classes that make me able to listen for incoming http message from a server without make a request so that an iPhone can send directly to another iPhone an instant message.

Thanks in advance and have a nice day!

L.

Lolloz89
  • 2,809
  • 2
  • 26
  • 41
  • not exat answer but the links below must be useful to see: http://stackoverflow.com/questions/6614343/tcp-based-rpc-server-erlang-or-something-similar-for-ios-android-app-communic and http://oreilly.com/iphone/excerpts/iphone-sdk/network-programming.html – ilhnctn Aug 02 '12 at 08:48

2 Answers2

1

From what I understand from your question, you need a listener. There are several 3rd party implementations that provide what you need. Basically you just need to open a socket for listening on a HTTP server running on your iPhone. Try these, it should provide you with what yo need

  1. CocoaHTTPServer.
  2. MongooseDaemon
Vlad
  • 3,346
  • 2
  • 27
  • 39
  • I think this should be the better way to do this. Can you suggest me some good tutorial to handle a POST request with one of theese? Thank you! – Lolloz89 Aug 02 '12 at 09:47
0

If youre looking for a way to receive message from WEB server - you may use Apple Notification service (here`s a good tutorial)

Another way is to use long-poll connection, but is not an easy thing to implement in IOS.

Maybe you can check for incoming message by requesting web server from iPhone (ex. every 10 seconds)?

  • Thanks for your answer but there is a problem in both the solutions: the first solutions is way away from what I have to do: create a network using the Java Servlet technology (the main target of my exam). the second solution could be an alternative but it's not exactly resource efficient. I'll consider this alternative if there is not any better solution. Thanks anymore.. – Lolloz89 Aug 02 '12 at 09:10