tomohisa / TCP

TCP sockets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TCP

Swift Zewo Platform License Slack Travis

Features

  • TCPConnection
  • TCPServer

##Usage

co {
  do {
    let server = try TCPServer(for: URI("tcp://0.0.0.0:8080"))
    let connection = try server.accept()
    let data = try connection.receive(max: 1024)
    try connection.send(data)
  } catch {
    print(error)
  }
}

let connection = try TCPConnection(to: URI("tcp://127.0.0.1:8080"))
try connection.open()
try connection.send("hello")
let data =  try connection.receive(upTo: 1024)
print(data)

Installation

import PackageDescription

let package = Package(
    dependencies: [
        .Package(url: "https://github.com/VeniceX/TCP.git", majorVersion: 0, minor: 7)
    ]
)

Support

If you need any help you can join our Slack 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.

Community

Slack

The entire Zewo code base is licensed under MIT. By contributing to Zewo you are contributing to an open and engaged community of brilliant Swift programmers. Join us on Slack to get to know us!

License

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

About

TCP sockets

License:MIT License


Languages

Language:Swift 100.0%