Swiftpack.co - Package - Balancingrock/SwifterSockets

SwifterSockets

A collection of socket utilities in pure Swift

SwifterSockets is part of the Swiftfire webserver project.

The Swiftfire website

The reference manual

SwifterSockets is also used in our PortSpy application in the App Store. Buyers of PortSpy get the complete sources of the project (Xcode project) used to build the App.

If you need secure connections, check out SecureSockets which is build on top of SwifterSockets (and OpenSSL).

If you are new to socket programming, check out our blog series which starts here

Features

  • Shields the Swift application from the complexity of the Unix socket calls.
  • Directly interfaces with the POSIX calls using:
    • connectToTipServer
    • tipTransfer
    • tipReceiverLoop
    • tipAccept
    • setupTipServer
  • Implements a framework on top of the POSIX calls with:
    • Connection (class)
    • connectToTipServer (returns a connection)
    • TipServer (class, produces connections)
  • Includes replacements for the FD_SET, FD_CLR, FD_ZERO and FD_ISSET macro's.
  • Builds as a library using the Swift Package Manager (SPM)

Installation

SwifterSockets can be used by the Swift Package Manager. Just add it to your package manifest as a dependency.

Alternatively you can clone the project and generate a Xcode framework in the following way:

  1. First clone the repository and create a Xcode project:

     $ git clone https://github.com/Balancingrock/SwifterSockets
     $ cd SwifterSockets
     $ swift package generate-xcodeproj
    
  2. Double click that project to open it. Once open set the Defines Module to 'yes' in the Build Settings before creating the framework. (Otherwise the import of the framework in another project won't work)

  3. In the project that will use SwifterSockets, add the SwifterSockets.framework by opening the General settings of the target and add the SwifterSockets.framework to the Embedded Binaries.

  4. In the Swift source code where you want to use it, import SwifterSockets at the top of the file.

Version history

No new features planned. Updates are made on an ad-hoc basis as needed to support Swiftfire development.

1.0.2

  • Documenation updates

1.0.1

  • Fixed website link in header

1.0.0

  • Restructured for Swiftfire 1.0.0

Github

link
Stars: 55
Help us keep the lights on

Dependencies

Releases

1.0.0 - Aug 18, 2019

Swiftfire -and all its supporting packages- have been issued in their release 1.0.0

SwifterSockets has undergone some file-renaming and some reorganization. Otherwise the functionality itself is unchanged.

0.11.0 - Apr 9, 2018

Switched to Swift Package Manager 4

0.10.11 - Apr 5, 2018

Minor adjustments for Swift 4.

0.10.10 - Mar 31, 2018

BRUtils was updated to 0.10.0

0.10.9 - Nov 25, 2017

BRUtils was updated to 0.9.0.