简体   繁体   English

服务器端在Java上使用Netty和客户端在C ++或Objective C上

[英]Server side on Java with Netty and client on C++ or Objective C

I'm making client-server app and we've chosen Netty as a connection management framework. 我正在制作客户端 - 服务器应用程序,我们选择Netty作为连接管理框架。 We use SSL TCP connections. 我们使用SSL TCP连接。 As of now, the client is also being made on Java. 截至目前,客户端也是基于Java的。 But in future the project should support mobile devices: Android and iOS. 但未来该项目应该支持移动设备:Android和iOS。 The question is: how painful is to implement C++ or Objective C client connecting to Java server on Netty? 问题是:在Netty上实现连接到Java服务器的C ++或Objective C客户端有多痛苦?

您可以使用CocoaAsyncSocket ,我已经将它用作服务器的客户端,该服务器使用我定义的协议在Netty中实现,该协议将以JSON的形式发送和接收数据,并且它与Netty一样好。

It really depends on what protocol you are using. 这实际上取决于您使用的协议。 If you define a protocol where you are sending serialised java objects as binary like this then you will trouble writing a client in a non JVM language. 如果你定义你在哪里发送序列化的Java对象为二进制像一个协议在非JVM的语言,那么你将麻烦写一个客户端。 If you use a text based protocol (see here ) or a HTTP based web-service then it will be easy. 如果您使用基于文本的协议(请参阅此处 )或基于HTTP的Web服务,那么它将很容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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