Swift binding for nanomsg
If Swift Package Manager is
used, add this package as a dependency in Package.swift
,
.Package(url: "https://github.com/autozimu/Nanomsg.swift.git", majorVersion: 0)
Push
import Nanomsg
let sock = try Socket(.PUSH)
try sock.connect("ipc:///tmp/pipeline.ipc")
try sock.send("Yo!")
Pull
import Nanomsg
let sock = try Socket(.PULL)
try sock.bind("ipc:///tmp/pipeline.ipc")
let msg: String = try sock.recv()
print(msg) // Yo!
More examples could be found in examples dir.