93 Commits
Author SHA1 Message Date
Bill Abt 78752613a2 Added new computed property, isSecure, to Socket. This resolves the optional Signature property and returns whether or not the socket is secured. 2016-11-30 12:36:54 -05:00
Bill Abt 199f40b499 Connection reset by peer can happen on a write to a socket as well as a read. 2016-11-29 10:49:12 -05:00
Bill Abt 8c5adb1ef6 Added UNIX domain socket support. Added additional tests to cover the new support. Added new error code, SOCKET_ERR_CONNECTION_RESET, to indicate that socket read failed due the connection being reset by the peer. 2016-11-29 10:17:47 -05:00
Bill Abt 209c581f5c Update documentation. Also added timeout parameter to isReadableOrWritable function. 2016-11-16 14:41:51 -05:00
Bill Abt cd34b6ed76 Handle SSL requested retry attempts for read and write functions. 2016-11-16 12:00:03 -05:00
Bill Abt 49c5af8b69 Minor (Quick Look) documentation improvements. 2016-10-26 10:30:02 -04:00
Bill Abt f12fb3a7a2 Remove in-code disablement of swiftlint warnings, now done in the .swiftlint.yml file at the root of the repo. 2016-10-25 14:45:39 -04:00
Bill Abt c38f5dd6ac Disable "questionable" swiftlint items. 2016-10-25 13:30:44 -04:00
Bill Abt 3f5544b49a Related to issue #22, while the listen function can be called with a port of zero (0) and the OS will assign a free port, attempts to connect to port zero (0) are invalid and should fail. Now they do. 2016-10-12 13:09:13 -04:00
Bill Abt 9008d21b09 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 unit tests to test this condition. 2016-10-12 11:36:54 -04:00
Bill Abt 6c0ef004d9 Update to the latest (10/7) toolchain. 2016-10-10 10:51:58 -04:00
Bill Abt 54c55956da Changed property isLittleEndian from a variable to a let constant. It'll never change. Update to #PR20. 2016-10-04 11:13:39 -04:00
Chun Chen Hsu 92c4111d8f Fix endian bug in hostnameAndPort function
The hostnameAndPort() function forgets to check endian-ness of host
before returning port number.
2016-10-03 04:34:20 -04:00
Bill Abt 18dcee6ea2 Minor change for clarity. 2016-09-27 09:29:19 -04:00
Bill Abt 210d541b01 Documentation update and fixes. 2016-09-27 09:03:20 -04:00
Bill Abt c5aca4ac1f Allow use on iOS, tvOS and watchOS as well as macOS. 2016-09-26 11:24:04 -04:00
Bill Abt dce1b9f335 Bug fix: remoteConnectionClosed should only be set in the readDataIntoStorage() function since that's the only place where we can actually tell that it actually happened. 2016-09-15 09:22:33 -04:00
Bill Abt af73b59e7d 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. 2016-09-13 13:06:43 -04:00
Bill Abt 1cc72f4f13 Listening socket was not being flagged as secure when it should've been. 2016-09-07 14:55:11 -04:00
Bill Abt e23d093e49 Update to latest toolchain (8/18). 2016-08-18 23:09:50 -04:00
Bill Abt 9f7465b3ed Minor change to initialize delegate function of SSLServiceDelegate. SSLService.inititalize(isServer:) became SSLService.initialize(asServer:). 2016-08-16 19:29:09 -04:00
Bill Abt b8f118a460 Update to latest Xcode (Beta 6) and toolchain (8/15). 2016-08-15 23:17:20 -04:00
Bill Abt aa0058681c Merged in support for non-blocking writes to TCP sockets per PR#15 against the legacy-0.7 branch. Thanks Shmuel. 2016-08-11 11:56:50 -04:00
Bill Abt e731be1cc4 Fixed a problem with assigning a new SSLService delegate in newly accepted sockets. Thanks Tim!!!. 2016-08-09 14:38:17 -04:00
Bill Abt 03834f9f33 Fixed merge error: Re-added Data based method for SocketReader and SocketWriter. 2016-08-09 09:16:31 -04:00
Bill Abt 7eca50c933 Fixed merge error. 2016-08-06 11:17:16 -04:00
Bill Abt b545b5f2ab Minor edit to remove conflict marker. 2016-08-05 21:20:03 -04:00
Bill Abt b2c6cff009 Merged master-next to master based on the 8/4 toolchain. 2016-08-05 21:18:23 -04:00
Bill Abt d1d9ea58fa Update to latest (8/4) toolchain. 2016-08-05 21:05:40 -04:00
Bill Abt 51e8f2cd8c Merged PR#13 into master-next and modified code to conform to the 7/29 toolchain. 2016-08-02 13:15:48 -04:00
Bill Abt 7b64a42215 Updates to documentation and project. Minor edits to PR to fix indentation. 2016-08-02 10:28:14 -04:00
Bill Abt fe800c8a6c Changes for the latest toolchain. 2016-08-02 09:05:09 -04:00
Shmuel Kallner f51a1b4b76 Added read(:inout Data) and write(:Data). Changed write(:NSData) to call write(:[UIbt8]) 2016-08-02 13:12:30 +03:00
Bill Abt 0e6c80076d Fix for Issue#10. Support arm architecture for FD utilities. 2016-07-27 14:15:39 -04:00
Bill Abt 35dddfa699 Renamed Socket.SocketError back to Error. Change protocol specification for Error to Swift.Error. 2016-07-26 15:52:18 -04:00
Bill Abt b923a1ec87 Updated to use latest (7/25) toolchain. 2016-07-26 11:35:49 -04:00
Bill Abt 834ad149a4 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. 2016-07-11 09:30:47 -04:00
Bill Abt 9e81d8a107 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. 2016-07-06 11:52:56 -04:00
Bill Abt 4974f5ca84 Updates for the new swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a builds. 2016-06-22 14:39:59 -04:00
Bill Abt 43b0b0c560 Added boolean value to the Signature to indicate whether the Socket instance is secure or not. 2016-06-02 15:07:23 -04:00
Bill Abt d94a75f015 Use new syntax for ignoring return value. 2016-06-02 09:38:14 -04:00
Bill Abt 2d7a3744e0 Updates for latest compiler. 2016-06-01 12:58:14 -04:00
Bill Abt 5aeca0523e Fixed reporting of error description. 2016-05-31 16:43:46 -04:00
Bill Abt 201973747d Changed delegate I/O functions to throw exceptions if a non-recoverable error occurs to provide better diagnostic information. 2016-05-27 09:46:55 -04:00
Bill Abt aeb8d63d44 Update delegate protocol documentation 2016-05-26 21:04:40 -04:00
Bill Abt 32ae031e3a Delegate function verifyConnection() does not need the Socket as a parameter. 2016-05-26 20:49:03 -04:00
Bill Abt c854cbefe6 Change SSLError.fail(Uint, String) to SSLError.fail(Int, String). 2016-05-26 20:29:50 -04:00
Bill Abt 51f6218583 Added hooks to use SSLService plugin which is NOT required. 2016-05-26 10:27:44 -04:00
Bill Abt 96cd35ddb9 Fixed bug where wait() was using seconds for timeout instead of milliseconds. 2016-05-24 16:18:53 -04:00
Bill Abt e7ef7bfd0c Added new wait() API to monitor an array of sockets, returning when data is available or timeout occurs. 2016-05-18 14:34:41 -04:00