简体   繁体   中英

Google Protocol Buffers with Objective-C and Java

I'm looking at setting up communication between an iPhone app and a Java based server and thought that google protocol buffers might be the way to go; however I've managed to get myself a bit confused and I'm not sure the best way to go about implementing this so I was hoping for a bit of friendly advice :)

Should I set up the Java server as a webservice and send the proto messages to it (via a post or something similar), or should I set up a client/server with the Java server accepting a connection and then the iPhone passing the proto message via the connection? I'm presuming the best way of doing it is to create an actual socket connection and pass messages back and forth that way; but I could be wrong and setting it up as a webserver with messages/responses could be the best way.

Any advice on the matter would be really appreciated.

Thanks,

Dan

I think it largely depends on how you plan to scale your application. A web server designed to run your servlet has scalability "baked in." If you just use a simple socket listener in a Java application, then where do you bring in the scalability? There are ways to do it, but you probably would not need to worry about those issues as much if you just used Tomcat.

The downside is that if you want to deploy something like Tomcat, there is a bit of a learning curve involved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM