ios - 在 iOS 上运行 gRPC 服务器

标签 ios grpc

是否可以在 iOS 上运行 gRPC 服务器?

假设我们想要使用 gRPC 框架来定义 API 等。现在我们想要在与使用它的应用程序相同的进程中部署 gRPC 服务器 - 通过 InprocessChannel 连接。

是否有适用于 iOS 的 gRPC 端口允许执行此操作?

最佳答案

是的,与 gRPC 的 Objective-C 绑定(bind)不同,可以使用 Swift GRPC 在 iOS 上运行 gRPC 服务器。 :

APIs and generated code is provided for both gRPC clients and servers, and can be built either with Xcode or the Swift Package Manager. Support is provided for all four gRPC API styles (Unary, Server Streaming, Client Streaming, and Bidirectional Streaming) and connections can be made either over secure (TLS) or insecure channels.

Echo example包含一个演示服务器和客户端代码的 Mac 应用程序。 iOS 应用程序中的 Swift gRPC 部分应该类似。

关于ios - 在 iOS 上运行 gRPC 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47082603/

相关文章:

c# - .NET 5 GRPC 客户端调用抛出异常 : Requesting HTTP version 2. 0,版本策略为 RequestVersionOrHigher,而 HTTP/2 未启用

macos - 如何在 Mac 中使用 grpcurl?

.net - WPF 桌面应用程序中的 gRPC 服务器?

ios - 将消息从自定义容器 View Controller 传递到包含的容器 View Controller 的子级?

ios - 如何从 Canvas 获取 CAEmitterLayer

iphone - 将 UISlider 连接到 fontSize

php - 在 Symfony 4.1 中使用 grpc,找不到 “Class ' Grpc\ChannelCredentials'。”

go - 协议(protocol) protoc-gen-go "timestamp"未定义

ios - UICollectionViewCell 无共同祖先错误(不重复)

ios - UITableView 中嵌入的 UICollectionView 中的 UICollectionViewCell 未按预期显示