The markdown parsing is broken/disabled for release notes. Sorry about that, I'm chasing the source of a crash that's been bringing this website down for the last couple of days.
Eliminate some compiler warnings
2 years ago
Include update for cocoapods
2 years ago
This release no longer supports Swift 4.x. The minimum supported Swift version is 5.0, while the minimum recommended version is 5.2.
# Version 1.0
Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux.
## Prerequisites
### Swift
* Swift Open Source `swift-4.0.0-RELEASE` toolchain (**Minimum REQUIRED for latest release**)
* Swift Open Source `swift-5.0-RELEASE` toolchain (**Recommended**)
* Swift toolchain included in *Xcode Version 10.2 (10E125) or higher*.
### macOS
* macOS 10.11.6 (*El Capitan*) or higher.
* Xcode Version 9.0 (9A325) or higher using one of the above toolchains.
* Xcode Version 10.2 (10E125) or higher using the included toolchain (*Recommended*).
### iOS
* iOS 10.0 or higher
* Xcode Version 9.0 (9A325) or higher using one of the above toolchains.
* Xcode Version 10.2 (10E125) or higher using the included toolchain (*Recommended*).
### Linux
* Ubuntu 16.04 (or 16.10 but only tested on 16.04 and 18.04).
* One of the Swift Open Source toolchains listed above.
### Other Platforms
* **BlueSocket** is **NOT** supported on *watchOS* since POSIX/BSD/Darwin sockets are not supported on the actual device although they are supported in the simulator.
* **BlueSocket** should work on *tvOS* but has **NOT** been tested.
### Add-ins
* [BlueSSLService](https://github.com/IBM-Swift/BlueSSLService.git) can be used to add **SSL/TLS** support.
- If using this package, please note that the **libssl-dev** package is required to be installed when building on Linux.
## Changes since 1.0.0
* When calling _getaddrinfo()_, the hints variable should reflect the protocol family of the socket.
* Added new parameter to _connect()_ to allow the caller to force the connection to the specific family of the Socket instance making call. The default behavior is to allow connection to any socket family.
* Big endian fixes. PR #130.
* Update to Swift 4.1.
* Fixed _connect()_ for UDP sockets. PR #137.
* Added CI support for Swift 4.2 builds. PR #138.
* Improve using _Signature_ to connect to socket. PR #147.
* Update to use Swift 4.2 as default. PR #151.
* Resolve Swift 5 compilation warnings. Drop Swift 3 support. PR #154.
* Added new parameter to TCP version of _listen_ API to allow caller to specify a particular address to listen on. This new parameter is defaulted to _nil_ and therefore should **NOT** affect current callers.
* Update the example in the README to correct a data race condition. Issue #115.
* Update CI support to use Swift 4.2.3. PR #169
* Update for Swift 5.0. PR #170.
* Add CI support for Xcode 11.
* Fixed problem with _endianess_ on big iron. PR #177.
* Update to use Swift 5.1 as default.
# Version 1.0
Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux.
## Prerequisites
### Swift
* Swift Open Source `swift-4.0.0-RELEASE` toolchain (**Minimum REQUIRED for latest release**)
* Swift Open Source `swift-4.2-RELEASE` toolchain (**Recommended**)
* Swift toolchain included in *Xcode Version 10.0 (10A255) or higher*.
### macOS
* macOS 10.11.6 (*El Capitan*) or higher.
* Xcode Version 9.0 (9A325) or higher using one of the above toolchains.
* Xcode Version 10.0 (10A255) or higher using the included toolchain (*Recommended*).
### iOS
* iOS 10.0 or higher
* Xcode Version 9.0 (9A325) or higher using one of the above toolchains.
* Xcode Version 10.0 (10A255) or higher using the included toolchain (*Recommended*).
### Linux
* Ubuntu 16.04 (or 16.10 but only tested on 16.04).
* One of the Swift Open Source toolchain listed above.
### Other Platforms
* **BlueSocket** is **NOT** supported on *watchOS* since POSIX/BSD/Darwin sockets are not supported on the actual device although they are supported in the simulator.
* **BlueSocket** should work on *tvOS* but has **NOT** been tested.
### Add-ins
* [BlueSSLService](https://github.com/IBM-Swift/BlueSSLService.git) can be used to add **SSL/TLS** support.
## Changes since 1.0.0
* When calling getaddrinfo(), the hints variable should reflect the protocol family of the socket. See issue #128.
* Added new parameter to connect() to allow the caller to force the connection to the specific family of the Socket instance making call. The default behavior is to allow connection to any socket family. See issues #129 and #128.
* Added support for big endian devices. PR #130.
* Added descriptive error messages for internal errors. PR #131.
* Update for Swift 4.1.
* Fixed minor warnings on Linux.
* Fixed problem with _connect()_ when using UDP sockets. PR #137.
* Update to include Swift 4.2 in CI builds.
* Added prerequisite that the **libssl-dev** package is required to be installed when building on Linux if using the BlueSSLService add-in.
* Minor license update.
* Performance fix for debug mode. PR #144.
* Added test for issue #139.
* _connect_ using signature changes. PR #147.
* Updates for Xcode 10 to project.
* Swift 4.2 support.
* Fixed buffer overflow problem that only showed up in optimized code. Issue #139.
* Make Swift 4.2 the default compiler in project.
* Update for Swift 4.2 (PR #151) and Xcode 10.
* Added CI support for building with Swift 5. PR #154.
* Added new parameter to TCP version of _listen_ API to allow caller to specify a particular address to listen on. This new parameter is defaulted to _nil_ and therefore should affect current callers.
Swift 4 Support.
7 years ago
This release minimally requires use of the swift-3.1.1-RELEASE toolchain or the swift-4.0.0-RELEASE toolchain which is _recommended_.
- Compatible with Xcode 9.0 (9A235) General Release or higher using one of the above toolchains.
- Added support for _arm_ architecture for FD utilities.
- Added nine (9) new tests to test suite including a full test server helper function that uses _Dispatch_.
- Added `read(into data: inout Data)` - This function reads all the data available on a socket and returns it in the `Data` object that was passed. This function has been added to the _SocketReader_ protocol.
- Added `write(from data: Data)` - This function writes the data contained within the `Data` object to the socket. This method has been added to the _SocketWriter_ protocol.
- Merged in support for non-blocking writes to TCP sockets per PR#15 submitted against the legacy-0.7 branch. **Also available at tag 0.7.6 for use with the 7/25 toolchain**.
- See README.md for more information about the new API.
- Added new property, `remoteConnectionClosed`, to enable differentiation between a socket that is no longer connected to its' remote partner and one that would block. If this property returns true, the remote connection has been closed and the socket should be closed.
- APIs based on _NSData_ and _NSMutable_ data will be deprecated in a future release.
- Removed verifyConnection() function from _SSLServiceDelegate_ protocol. Now handled internally by _SSLService_ itself.
- Minor change to initialize delegate function of _SSLServiceDelegate_. _SSLService.inititalize(isServer:)_ became _SSLService.initialize(asServer:)_.
- Updated example in README.md to use multi-threaded _Dispatch_ based API.
- Added continuous integration (PR#16) include build badge in `README.md`.
- Allow use on iOS, tvOS and watchOS as well as macOS.
- Added `endianness check` for host before byte swapping (PR#20).
- Added fix for issue #22. When requesting to listen on port 0, the port assigned by the OS was not being returned in the `Signature`. Hence, the caller would not know what port was assigned and is being listened to. Added two additional unit tests to test this condition. Also, related to this, passing of a zero (0) for port when attempting to `connect` is _invalid_ and will now be cause for an exception being thrown.
- Added support for using _UNIX Domain Sockets_. See the `README.md` for more information.
- Read and write function can now throw a _SOCKET_ERR_CONNECTION_RESET_ exception in the event the connection was reset by the peer.
- Added new computed property, `isSecure`, at the `Socket` level to resolve the optional `signature` property and returns true if the socket is secure and false otherwise.
- Updated tests to account for serverHelper launch and take down.
- Added UDP support. See the `README.md` for more information.
- Fixed issue #46.
- Fixed issue [#959](https://github.com/IBM-Swift/Kitura/issues/959) from Kitura.
- Fixed a crash bug revealed in BlueSSLService issue [#10](https://github.com/IBM-Swift/BlueSSLService/issues/10).
- Fixed issue #49. File representing a UNIX socket should not be deleted when a client socket is closed. Only the listening socket should delete the file.
- Fixed issue #50.
- Added documentation (as a result of issue #53) that documents how to set the socket read buffer size.
- Changed how certain flags were being reset during the close of a socket. Related to issue #53. Also removed old debug statement and redundant memory clearing calls.
- Merged PR #54 to correct warnings under Swift 3.1.
- Merged PR #55 to correct memory leaks related to getAddrInfo.
- In response to issue #56, added two new functions that allow the setting of a read and/or write timeout. See the `README.md` for more information.
- Merged PR #57 to add *CocoaPod* support.
- Added usage information for CocoaPods.
- Merged PR #60 which now allows port sharing between IPV6 and IPV4 sockets.
- When the SSLServiceDelegate is set to a non-nil value, increase the read buffer size to accommodate the TLS packet size. Related to issue [#22](https://github.com/IBM-Swift/BlueSSLService/issues/22) in *BlueSSLService*.
- Added code to validate the port values passed to connect(to:port:) function and ensure they fall within the proper range.
- Merged PR #61: Set SO_REUSEPORT for port sharing on macOS.
- Merged PR #62.
- Corrected buffer overflow problem when doing certain TCP reads the use the `truncate` parameter. See issue [#66](https://github.com/IBM-Swift/BlueSocket/issues/66).
- Changed podpsec Swift version to 3.1.1.
- Update podspec to include watchOS and tvOS. PR #70
- Support of Xcode 9 Beta.
- Support for ALPN in SSLServiceDelegate. PR #67
- Merge PR #72 to fix problem reported by issue #68.
- Fixed issue #81, If the attempt to set the *SO_REUSEPORT* socket option fails, check *errno* for *ENOPROTOOPT* and if set, silently ignore the error. This can happen when using WSL (Windows Subsystem for Linux).
- Added new utility function, udpBroadcast, to allow enablement and disablement of broadcast mode for UDP sockets. This fixes issue #80.
- Fixed bug in new utility function, _udpBroadcast_, that was causing the inverse of what it was supposed to do.
- Added enhancement to _connect_ API to allow for a connection timeout (issue #65). See the documentation in the README.md for how to use the new API.
- Swift 4 Support.
- Merged PR #85 to allow deferral of SSL accept. This fixes BlueSSLService issue [#40](https://github.com/IBM-Swift/BlueSSLService/issues/40). For more details and discussion refer to that issue.
- Fixed bug related to PR #85.
- Removed _watchOS_ support. See issue #87 for more info.
- Fixed problem on macOS when using _connect_ API. See issue #88 for more info.
- Update _FD*_ functions to consistently used _Int32_ where appropriate.
- Allow _wait()_ function to be called on UDP sockets that are bound.
- Add new parameter for _listen()_ API that allows the caller to decide whether to reuse the listening port or not. _Default_ behavior is to reuse the port. Resolves issue #94.
- Removed unsafe access to _Socket.Address_, PR #93.
- Corrected some outdated documentation in _README.md_, issue #96.
- Added tvOS target to Xcode project, issue #100.
- Minor project changes for tvOS.
- Remove build on Xcode 8.3.
- CI updates.
- Clarify use of the _isReadableOrWritable()_ function when attempting to write to a newly connected socket. Issue #105.
- Cleanup and minor bug fix. PR #107.
- Rolled back _fd_set_ extension from PR #107 to fix crash bug. Added additional tests to ensure this kind of crash bug doesn't get through again.
- Added back the now fixed _fd_set extension_. PR #111.
- The _connect(to:port:timeout:)_ API will now throw an exception if called on a non-blocking socket without the optional _timeout_ being passed with a value greater than zero. Updated documentation to reflect this.
- Changes to adapt to Swift 4.1. Encompasses PR #121 and other related changes.
- Fixed a bit-addressing error in fd_set implementation. Make sure that the temporary socket opened in _Socket.connect(to:port:timeout:)_ is closed in the event of an error being thrown. See PR #126 for more information. This fixes the following issues: #120, #123 and #125.
Update to latest Xcode (Beta 6) and toolchain (8/15).
7 years ago
This release requires use of the swift-DEVELOPMENT-SNAPSHOT-2016-08-15-a toolchain.
- Compatible with Xcode 8 Beta 6 using the above toolchain.
- Added support for _arm_ architecture for FD utilities.
- Added nine (9) new tests to test suite including a full test server helper function that uses _Dispatch_.
- **IMPORTANT NOTE** Testing requires a working _Dispatch_ module in the toolchain. See the `README.md` for more information.
- Added `read(into data: inout Data)` - This function reads all the data available on a socket and returns it in the `Data` object that was passed. This function has been added to the _SocketReader_ protocol.
- Added `write(from data: Data)` - This function writes the data contained within the `Data` object to the socket. This method has been added to the _SocketWriter_ protocol.
- Merged in support for non-blocking writes to TCP sockets per PR#15 submitted against the legacy-0.7 branch. Also available at tag 0.7.6 for use with the 7/25 toolchain.
- See README.md for more information about the new API.
- _NSData_ and _NSMutable_ data will be deprecated in a future release.
- Removed verifyConnection() function from _SSLServiceDelegate_ protocol. Now handled internally by _SSLService_ itself.
- Minor change to initialize delegate function of _SSLServiceDelegate_. _SSLService.inititalize(isServer:)_ became _SSLService.initialize(asServer:)_.
- Updated example in README.md to use multi-threaded _Dispatch_ based API.
- Added instructions for building and installing _Dispatch_ into the 8/15 Linux toolchain.
New APIs, new platform support, new test suite, new (8/7) toolchain.
7 years ago
This release requires use of the swift-DEVELOPMENT-SNAPSHOT-2016-08-04-a toolchain or the new swift-DEVELOPMENT-SNAPSHOT-2016-08-07-a toolchain. The use of the 8/7 toolchain is recommended.
- Added support for _arm_ architecture for FD utilities.
- Added nine (9) new tests to test suite including a full test server helper function that uses _Dispatch_.
- **IMPORTANT NOTE** Testing requires a working _Dispatch_ module in the toolchain. See the `README.md` for more information.
- Added `read(into data: inout Data)` - This function reads all the data available on a socket and returns it in the `Data` object that was passed. This function has been added to the _SocketReader_ protocol.
- Added `write(from data: Data)` - This function writes the data contained within the `Data` object to the socket. This method has been added to the _SocketWriter_ protocol.
- Merged in support for non-blocking writes to TCP sockets per PR#15 submitted against the legacy-0.7 branch. Also available at tag 0.7.6 for use with the 7/25 toolchain.
- _NSData_ and _NSMutable_ data will be deprecated in a future release.
- Removed verifyConnection() function from _SSLServiceDelegate_ protocol. Now handled internally by _SSLService_ itself.
- See README.md for more information about the new API.
- Works with Xcode 8 Beta 4 using the above toolchain.
- Updated example in README.md to use multi-threaded _Dispatch_ based API.
- Added instructions for building and installing _Dispatch_ into the 8/4 or 8/7 Linux toolchain.
New APIs, new platform support, new test suite.
7 years ago
This release requires use of the new swift-DEVELOPMENT-SNAPSHOT-2016-07-25-a toolchain.
- Added support for _arm_ architecture for FD utilities.
- Added beginnings of a test suite.
- Added `read(into data: inout Data)` - This function reads all the data available on a socket and returns it in the `Data` object that was passed.
- Added `write(from data: Data)` - This function writes the data contained within the `Data` object to the socket.
- See README.md for more information about the new API.
- Works with Xcode 8 Beta 4 Default Toolchain.
Updates for the swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a toolchain
7 years ago
This release requires use of the new swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a toolchain.
- Changes in response to Issue #6. Socket.wait() now supports a timed wait based on a passed timer value, an immediate return (i.e. quick check) and an indefinite wait.
- Changed SOCKET_DEFAULT_MAX_CONNECTIONS to SOCKET_DEFAULT_MAX_BACKLOG and changed the default from 5 to 50.
- Added SOCKET_MAX_DARWIN_BACKLOG for macOS.
- Changed the signature of listen(on port: Int, maxPendingConnections: Int) to listen(on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG) and removed the listen(on port: Int) API since the same can be accomplished using defaults.
- Updated documentation in README.md to reflect changes.