19 Commits

Author SHA1 Message Date
Bill Abt 48a77e2e35 Documentation quality and consistency improvements. 2018-12-14 10:56:36 -05:00
David Jones cfe4868e27 Resolve Swift 5 compilation warnings 2018-11-27 16:53:58 +00:00
Bill Abt 1c6757164f For consistency with the rest of the project, converted spaces to tabs. 2018-04-12 09:50:34 -04:00
Takuya Nakaike 441e3d5cfa Removed parentheses 2018-04-10 19:23:20 +09:00
Takuya Nakaike 1606b1b059 Modified #if condition to _endian(big) 2018-04-10 11:51:55 +09:00
Takuya Nakaike 2fea7f037f Inserted #if guard for s390x 2018-04-03 14:45:52 +09:00
Takuya Nakaike f2c9b5dd29 Fix for big-endian machines
fd_set is defined as 16 64-bit integers in a 64-bit linux machine. Since this package accesses fd_set per 32 bits, endianess needs to be taken aware to calculate the index.
2018-03-30 17:39:26 +09:00
Jim Dovey 74bbadbc7a Fixed a bit-addressing error in fd_set implementation.
- Now uses an unsigned type to perform the bit-shift operation and then casts to signed type using `init(bitPattern:)`.
- Added a unit test case which ensures fd values from zero to (arbitrarily) 128 can all be inserted and removed from the fd_set.
2018-02-22 12:42:08 -08:00
ShihabMehboob fd15ef5d44 Squashed commit of the following:
commit d658dc3618946a6d295f1604fb8a8378d8d3f1f6
Author: ShihabMehboob <shihab.mehboob1@ibm.com>
Date:   Wed Feb 14 13:18:31 2018 +0000

    Updates to Swift 4.1

commit fc48ea6a203914081a060424d79af89a96578c7b
Author: ShihabMehboob <shihab.mehboob1@ibm.com>
Date:   Wed Feb 14 13:14:17 2018 +0000

    Updates to Swift 4.1

commit 3f2c276c247aa4d97a52a65eae0804fa3028261b
Author: ShihabMehboob <shihab.mehboob1@ibm.com>
Date:   Wed Feb 14 13:13:56 2018 +0000

    Updates to Swift 4.1

commit 664e5ce38c679498a8f35a7adbc22beb70cd08b4
Author: ShihabMehboob <shihab.mehboob1@ibm.com>
Date:   Wed Feb 14 13:11:01 2018 +0000

    Updates to Swift 4.1

commit 985ea641cbbb1cc7d37a8aa1a19ca019221f0b81
Author: ShihabMehboob <shihab.mehboob1@ibm.com>
Date:   Wed Feb 14 12:52:38 2018 +0000

    Updates to Swift 4.1

commit 1f74bb681948aca741c3dec025f73aa341efef0f
Author: ShihabMehboob <shihab.mehboob1@ibm.com>
Date:   Mon Feb 12 10:27:00 2018 +0000

    Support Swift 4.1

commit c86c534b84fb0fcee04030ae948650ab3f5e78df
Author: ShihabMehboob <shihab.mehboob1@ibm.com>
Date:   Thu Feb 8 13:59:20 2018 +0000

    Support Swift 4.1
2018-02-14 13:20:55 +00:00
Bill Abt 5c07437ab5 Added documentation for public functions. Minor format changes for consistency. 2018-01-27 08:57:26 -05:00
Jim Dovey fec7cf7438 Fixed the bug in the new fd_set implementation on macOS. 2018-01-26 16:49:44 -08:00
Bill Abt d3c5ff3ecd Rollback the fd_set extension changes from PR #107 to the original. The changes were causing a crash bug whenever the new fd_set extensions were called. 2018-01-22 10:32:30 -05:00
Bill Abt 45da6eb972 Minor style changes. 2018-01-19 09:21:06 -05:00
Jim Dovey 171c7570d7 A few cleanups and one bug fix:
- `fd_set` API is now much nicer and will compile about as close to the C implementation as we can get— especially on release builds, with compiler inlining.
- Socket structure's `readBuffer` now initializes all its bytes to zero, not just the first.
- More idiomatic/concise return expression in `Socket.wait(for:timeout:waitForever:)` (don't build an output array manually, we have `filter(_:)` for that).
- Various non-Linux code to set the `SO_NOSIGPIPE` option has been tucked into a private function now, still containing the compilation conditional. It's a no-op on Linux, and will be inlined by the compiler (since it's private) and the calling code looks much more straightforward.
- BUGFIX: calls to `gai_strerror(_:)` take the result of the `getaddrinfo()` call as a parameter, NOT `errno`.
2018-01-16 12:53:27 -08:00
Bill Abt abfe351df1 Added missing documentation for new Socket.Address extensions introduced by PR #93. 2017-10-26 10:00:02 -04:00
Fred Cox 2d58a7a264 Remove unsafe access to Socket.Address
asAddr funcs were passing unsafe pointers outside of the callbacks in which try should be used
Using callback to make all the access within these callbacks
Fixes bug where IPv6 address was 'cast' to sockaddr but actually was zero'd beyond the length of sockaddr_in and packets written to the wrong address
2017-10-12 10:51:40 +03:00
Bill Abt 51bde30c86 Update FD_* functions to consistently use Int32 where appropriate. 2017-10-06 09:45:05 -04:00
Bill Abt a985882a9f Posix/BSD/Darwin sockets are not supported by watchOS on native devices. Therefore, removed package/compilation support for that platform. 2017-09-21 10:54:24 -04:00
Quan Vo 558fdeb7b6 Swift 4 support 2017-08-23 11:36:57 -05:00