swiftsocket / SwiftSocket

The easy way to use sockets on Apple platforms
BSD 3-Clause "New" or "Revised" License
1.68k stars 402 forks source link

Add an `isBlocking` parameter to the `connect` method #140

Closed vladvlasov256 closed 6 years ago

vladvlasov256 commented 6 years ago

Add blocking socket connections support.

Example:

switch client.connect(timeout: defaultTimeout, isBlocking: true) {
  ...
}

By default socket connections are non-blocking as previously.

pengyunchou commented 6 years ago

use timeout insted