Discussion\n\nPushing info to clients\n\n\nLong Polling\n\n\nClient sends request to server, waits for response or timeouts (Loop)\nCan send and receive information, but not full-duplex\niOS Implementation\n\n\nNSURLConnection sendSynchronousRequest\n\n\nCommon uses\n\n\nFallback from Websockets and SSE when streams are unreliable or impractical\n\n\n\n\nHTTP Streams\n\n\nCan only push information to your client\nIf you need to send info back to server use standard rest approach\nTransported over simple HTTP\nBuilt in support for re-connection and event-id\niOS Implementation\n\n\nServer Sent Events (SSE)\nNSURLSession, NSInputStream, NSSteamEvent\nSetup the connection\nImplement code to handleEvents from the input stream\n\n\nCommon uses\n\n\nStock ticker streaming\n\u201cStatus\u201d feed updating\nPush Notifications\n\n\n\n\nWebsockets\n\n\nDesigned to overcome many of the pitfalls/shortcomings described in RFC 6202\nStandardized by IETF (Internet Engineering Task Force) in 2011\nCan send and receive information (full-duplex pipe)\nProtocol based on TCP\nUses HTTP only for initial handshake, while leveraging existing HTTP infrastructure\niOS Implementation\n\n\nCFStreamCreatePairWithSocketToHost takes url, read and write stream\nCast read and write stream to NSInputStream and NSOutputStream, respectively\nSet delegate for input and output streams\nSchedule both in a run loop (Can do without but will block the execution of other code)\nOpen connection\nWrite code to handleEvents from the input stream\nImplement message sending via the output stream\n\n\nServer considerations\n\n\nNot as easy to get started with as a generic web server\nBuy one, borrow one or build one\n\n\nCommon uses\n\n\nChat\nPlayer vs. Player games\nReal time interactions\n\n\n\n\nPopular Abstractions/Frameworks\n\n\nTRVSEventSource from Travis Jeffery\nSignalR from Microsoft\n\n\n\n\n\nAt-a-glance Comparison\n\n\n\n\n \n Websockets \n SSE \n Long Polling \n\n\n\n\n Client Performance \n Best \n Best \n Worst \n\n\n Server Performance \n Best \n Worst \n Worst \n\n\n Complexity \n Highest \n Lowest \n Mid \n\n\n When to Use \n 2-way messaging \n Push to Client \n Just getting started \n\n\n\n\n\nPicks\n\nDarryl\n\n\nProportional Spacing with Auto Layout\n\n\n\nJohn\n\n\nGoogle Cloud Vision API Detects types of images, landmarks, recognizes text, does image sentiment analysis and can even detect \u201cinappropriate content\u201d\nAgile and Beyond 2016 May 5-6 in Ypsilanti, MI\n\n\n\nAlternative show title suggestions\n\n\nUncanny valley\nThe cooker's always on\nCanonical Framing Technique