ios - Server socket with swift -


this question has answer here:

i want able have 1 ios-device multiple ios-devices (is there max?) able connect , send data(a string in case) first device.

i have tried tutorial: http://www.raywenderlich.com/3932/networking-tutorial-for-ios-how-to-create-a-socket-based-iphone-app-and-server have hard time understanding objective-c

actually, swift same objc. need port syntax objc swift:

func initnetworkcommunication() {     var readstream : unmanaged<cfreadstream>?;     var writestream : unmanaged<cfwritestream>?;     cfstreamcreatepairwithsockettohost(nil, "localhost", 80, &readstream, &writestream);     if let read = readstream {         inputstream = readstream!.takeunretainedvalue()     }     if let write = writestream {        outputstream = writestream!.takeunretainedvalue()     } } 

and on...


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -