Skip to content

Commit

Permalink
Added travis-ci && updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
OrkhanAlikhanov committed Jul 10, 2017
1 parent 292a347 commit f9f6630
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 8 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
language: generic
matrix:
include:
- os: linux
dist: trusty
sudo: required
install: eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
script: swift test

- os: osx
osx_image: xcode8.3
dist: trusty
sudo: required
env: ACTION=test PLATFORM=Mac DESTINATION='platform=OS X'
script: set -o pipefail && xcodebuild -scheme SocketSwift -destination "$DESTINATION" $ACTION | xcpretty

- os: osx
osx_image: xcode8.3
dist: trusty
sudo: required
env: ACTION=test PLATFORM=iOS DESTINATION='platform=iOS Simulator,name=iPhone 6S'
script: set -o pipefail && xcodebuild -scheme SocketSwift -destination "$DESTINATION" $ACTION | xcpretty

- os: osx
osx_image: xcode8.3
dist: trusty
sudo: required
env: ACTION=test PLATFORM=tvOS DESTINATION='platform=tvOS Simulator,name=Apple TV 1080p'
script: set -o pipefail && xcodebuild -scheme SocketSwift -destination "$DESTINATION" $ACTION | xcpretty

33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
[![Platform](https://img.shields.io/cocoapods/p/Socket.swift.svg?style=flat)](https://github.com/BiAtoms/Socket.swift)
![Platform Linux](https://img.shields.io/badge/platform-Linux-green.svg)
[![Platform iOS macOS tvOS](https://img.shields.io/cocoapods/p/Socket.swift.svg?style=flat)](https://github.com/BiAtoms/Socket.swift)
[![Cocoapods Compatible](https://img.shields.io/cocoapods/v/Socket.swift.svg)](https://cocoapods.org/pods/Socket.swift)
[![Build Status - Master](https://travis-ci.org/BiAtoms/Socket.swift.svg?branch=master)](https://travis-ci.org/BiAtoms/Socket.swift)

# Socket.swift

A POSIX socket wrapper written in swift.

## Requirements
## OS

Works in linux, iOS, macOS and tvOS

- iOS 8.0+
- Xcode 8.0+
- Swift 3.0+
## Example
```swift
let server = try Socket.tcpListening(port: 8090) //start socket listening at localhost:8090

let client = try Socket(.inet, type: .stream, protocol: .tcp)
try client.connect(port: 8090) //connecting to the socket at localhost:8090
let clientAtServerside = try server.accept()

let bytes = ([UInt8])("Hello World".utf8)
try clientAtServerside.write(bytes) //sening bytes to the client socket
clientAtServerside.close()

while let byte = try? client.read() { //reading bytes sent by server socket
print(byte)
}
client.close()
server.close()
```

## Installation

Expand All @@ -26,7 +45,7 @@ To integrate Socket.swift into your Xcode project using CocoaPods, specify it in
```ruby
source 'https://github.com/CocoaPods/Specs.git'
target '<Your Target Name>' do
pod 'Socket.swift' ~> '1.0'
pod 'Socket.swift' ~> '1.3'
end
```

Expand All @@ -36,7 +55,7 @@ Then, run the following command:
$ pod install
```
### Manually
Just drag and drop the [Sources/Socket.swift](Sources/Socket.swift) file.
Just drag and drop the files in the [Sources](Sources) folder.

## Authors

Expand Down
2 changes: 1 addition & 1 deletion Socket.swift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Socket.swift'
s.version = '1.1'
s.version = '1.3'
s.summary = 'A POSIX socket wrapper written in swift.'
s.homepage = 'https://github.com/BiAtoms/Socket.swift'
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down

0 comments on commit f9f6630

Please sign in to comment.