JSON-RPC over unix domain socket

Hi, I am new to macOS development and just started learning about macOS development and Swift.

I have a requirement that i need to make a json-rpc client which would connect to the server over a unix domain socket. Now i found the json-rpc example in the swift-nio package, but being new to the language finding it quite difficult to follow the code.

Can someone point me to other resources (blog posts/tutorials) which explains about the Swift-Nio module and how would someone implement JSON-rpc with it. Or any other modules which would help me achieve this without directly using Swift-NIO.

Thanks,
Anjan

Thanks for your question! Sure, there are a few tutorials for getting started with SwiftNIO, if you search for "SwiftNIO tutorial" you should be able to find quite a few actually. Additionally, there are quite a few conference talks available that cover various bits of SwiftNIO which you can find on Youtube (search just "SwiftNIO").

The most directly useful one for you however will be @tomerd's talk on implementing JSON-RPC with SwiftNIO. The example in swift-nio-examples is actually the whole code which will contain what was presented in the conference talk.

If you get stuck at any point, please feel to reach out here and we can help to answer whatever questions you have. Once the basic architecture makes sense to you, the API docs might also help you.

1 Like