Skip to content

Instantly share code, notes, and snippets.

@MickaelCruzDB
Created July 15, 2015 14:19
Show Gist options
  • Save MickaelCruzDB/2769e1ab29fe280b0198 to your computer and use it in GitHub Desktop.
Save MickaelCruzDB/2769e1ab29fe280b0198 to your computer and use it in GitHub Desktop.
while true{
if var client=server.accept(){
echoService(client: client)
var data=client.read(1024*10)
if let d=data{
if let str=String.stringWithBytes(d, length: d.count, encoding: NSUTF8StringEncoding){
println(str)
}
}
}else
{
println("accept error")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment