目录
目录README.md

ZeroMQKit

Swift Platform License

ZeroMQKit is a 0mq binding for Swift 4 and this repository is a fork of ZeroMQ.

Features

  • Context
  • Socket
  • Message
  • Poller
  • Proxy

Example

import ZeroMQKit

guard let context = try? Context() else {
    fatalError("Context could not be instantiated")
}

guard let inbound = try? context.socket(.pull) else {
    fatalError("Cannot create socket to .pull")
}
try? inbound.bind("tcp://127.0.0.1:5555")

if let outbound = try? context.socket(.push) {
    try outbound.connect("tcp://127.0.0.1:5555")
    
    _ = try outbound.send("Hello World!")
    _ = try outbound.send("Bye!")
}

while let data = try? inbound.receive(), let value = data, value != "Bye!" {
    print(value) // "Hello World!"
}

Installation

Install ZeroMQ system library

./setup_env.sh

Add ZeroMQ to Package.swift

import PackageDescription

let package = Package(
    dependencies: [
        .package(url: "https://github.com/unnamedd/ZeroMQ.git", .upToNextMajor(from: "1.0.0")),
    ]
)

Support

If you need any help you can join on Slack of Zewo and go to the #help channel. Or you can create a Github issue in our main repository. When stating your issue be sure to add enough details, specify what module is causing the problem and reproduction steps.

License

This project is released under the MIT license. See LICENSE for details.

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号