KCP - A Fast and Reliable ARQ Protocol
- carthage
github "aixinyunchou/SwiftKcp"
- input swiftkcp
import SwiftKcp
- create kcp object:
let sender = Kcp(outputer:self)
- setup output delegate:
func kcp(kcp:Kcp,outputData:Data) -> Int{ //just send data to you udp or tcp target }
- call update in an interval:
sender.update(millisec:now)
- input lower layer data packet:
let reciveData = //read data from you tcp or udp socket sender.input(data:reciveData)