2015AppleInc.
Allrightsreserved.
RedistributionorpublicdisplaynotpermittedwithoutwrittenpermissionfromApple.
#WWDC15NetworkingwithNSURLSessionLukeCaseSoftwareEngineerAndreasGarkuschaSoftwareEngineerDanVinegradSoftwareEngineerSystemFrameworksSession711AppTransportSecurityNewprotocolsupportinNSURLSessionNSURLSessiononwatchOSNSURLSessionAPIchangesNSURLSessionAPIfordownloadingHTTPcontentRichsetofdelegatemethodsBackgrounddownload/uploadcapabilityHTTP(cleartext)HTTP(cleartext)GETHTTP/1.
1200OKHTTP(cleartext)HTTP(cleartext)HTTP(cleartext)HTTPSHTTPSHTTPSHTTPoverTLSEncryptionIntegrityAuthenticationProtectingCustomerDataHTTPS:securingHTTPwithTLS"http://"to"https://"ServersupportrequiredWidespreadsupportavailableAlldataissensitiveAppTransportSecurityProtectingCustomerDataWhatisAppTransportSecurity(ATS)DisallowscleartextHTTPURLloadsEncouragesbestpracticesecureconnectionsDefaultstostrongersecurityAllowscongurationviaapp'sInfo.
plistHTTPSNSAppTransportSecurityNSExceptionDomains"example.
com"NSIncludesSubdomains=YESNSExceptionRequiresForwardSecrecy=NONSExceptionMinimumTLSVersion="TLSv1.
1"HTTPSHTTPSMediaServerNSAppTransportSecurityNSExceptionDomains"media.
example.
com"NSExceptionAllowsInsecureHTTPLoads=YESNSAppTransportSecurityNSAllowsArbitraryLoads=YESServerNSAppTransportSecurityNSAllowsArbitraryLoadsNSExceptionDomains"secure.
example.
com"NSExceptionAllowsInsecureHTTPLoads=NOConguringATSDiagnosingissuesActivewhenyoubuildyourappforiOS9andOSXElCapitan"http://"to"https://"isautomaticUseNSAllowsArbitraryLoadsforquicktriageLogNSURLSessionerrorsCFNETWORK_DIAGNOSTICS=1ProtectingCustomerDataNextstepsUseHTTPSfornewprojectsTransitionexistingappsfromHTTPtoHTTPSUseexceptionswhereneededNewProtocolSupportinNSURLSessionAndreasGarkuschaSoftwareEngineerNewinNSURLSessionNewinNSURLSessionHTTP/2RFC7540NewinNSURLSessionHTTP/2RFC7540NewinNSURLSessionNewinNSURLSessionNewinNSURLSessionHTTP/2RFC7540FutureoftheWebMajormilestoneintheevolutionoftheWebMakestheWebfasterSolvesHTTP/1.
1problemsHTTP/2inNSURLSessionWhyanewprotocolHTTP/2indepthAdoptionusingNSURLSessionWhyaNewProtocolWhyaNewProtocolWhyaNewProtocolFTPHTTPPOP3LDAPRTPSMTPNTPTCPIMAPUDPARPSNMPPPPSOAPICMPIPAPXTelnetRADIUSVNCSSHVoIPAFPsmbnfsDHCPSKYPERDPWebSocketRIPAIMBonjourICQQUAKE3…WhyaNewProtocolFTPHTTPPOP3LDAPRTPSMTPNTPTCPIMAPUDPARPSNMPPPPSOAPICMPIPAPXTelnetRADIUSVNCSSHVoIPAFPsmbnfsDHCPSKYPERDPWebSocketRIPAIMBonjourICQQUAKE3…WhyaNewProtocolHTTP/1.
1CommonIssuesHTTP/1.
1CommonissuesOneoutstandingrequestHTTP/1.
1CommonissuesOneoutstandingrequestHTTPpipeliningHTTP/1.
1CommonissuesOneoutstandingrequestHTTPpipeliningMultipleconnectionsHTTP/1.
1CommonissuesOneoutstandingrequestHTTPpipeliningMultipleconnectionsTextualprotocoloverheadHTTP/1.
1CommonissuesOneoutstandingrequestHTTPpipeliningMultipleconnectionsTextualprotocoloverheadHeadercompressionThePathtoHTTP/2ExperimentalprotocolsSpecicationforHTTP/2IETFstandardization,RFCNewinNSURLSessionNewinNSURLSessionHTTP/2RFC7540HTTP/1.
1HTTP/2HTTP/1.
1HTTP/2MultipleTCPconnectionstoahostOnlyoneTCPconnectionHTTP/1.
1HTTP/2MultipleTCPconnectionstoahostOnlyoneTCPconnectionHead-of-lineblockingFullymultiplexedHTTP/1.
1HTTP/2MultipleTCPconnectionstoahostOnlyoneTCPconnectionHead-of-lineblockingFullymultiplexedFIFOrestrictionsRequestshaveprioritiesHTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/1.
1:Head-of-LineBlockingHTTP/2:MultiplexingPriorityLegendLowMediumHigh(withoutPipelining)HTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/1.
1:Head-of-LineBlockingHTTP/2:MultiplexingPriorityLegendLowMediumHighimage.
jpgstyles.
cssdata.
xml(withoutPipelining)HTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/1.
1:Head-of-LineBlockingHTTP/2:MultiplexingPriorityLegendLowMediumHighimage.
jpgstyles.
cssdata.
xmlGET(withoutPipelining)200OKHTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/1.
1:Head-of-LineBlockingHTTP/2:MultiplexingPriorityLegendLowMediumHighimage.
jpgstyles.
cssdata.
xmlGET(withoutPipelining)HTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/1.
1:Head-of-LineBlockingHTTP/2:MultiplexingPriorityLegendLowMediumHighimage.
jpgstyles.
cssdata.
xml(withoutPipelining)HTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/1.
1:Head-of-LineBlockingHTTP/2:MultiplexingPriorityLegendLowMediumHighimage.
jpgstyles.
cssdata.
xml(withoutPipelining)HTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/1.
1:Head-of-LineBlockingHTTP/2:Multiplexingimage.
jpgstyles.
cssdata.
xml(withoutPipelining)PriorityLegendLowMediumHighHTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/1.
1:Head-of-LineBlockingHTTP/2:Multiplexingimage.
jpgstyles.
cssdata.
xml(withPipelining)PriorityLegendLowMediumHighHTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/2:Multiplexingimage.
jpgstyles.
cssdata.
xmlHTTP/1.
1:Head-of-LineBlocking(withPipelining)PriorityLegendLowMediumHighHTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/2:Multiplexingimage.
jpgstyles.
cssdata.
xmlimage.
jpgstyles.
cssdata.
xmlHTTP/1.
1:Head-of-LineBlocking(withPipelining)PriorityLegendLowMediumHighHTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/2:Multiplexingimage.
jpgstyles.
cssdata.
xmlimage.
jpgstyles.
cssdata.
xmlHTTP/1.
1:Head-of-LineBlocking(withPipelining)PriorityLegendLowMediumHighHTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/2:Multiplexingimage.
jpgstyles.
cssdata.
xmlimage.
jpgstyles.
cssdata.
xmlHTTP/1.
1:Head-of-LineBlocking(withPipelining)PriorityLegendLowMediumHighHTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/2:Multiplexingimage.
jpgstyles.
cssdata.
xmlimage.
jpgstyles.
cssdata.
xmlHTTP/1.
1:Head-of-LineBlocking(withPipelining)PriorityLegendLowMediumHighHTTP/2-MultiplexingSolutionforHead-of-LineBlockingproblemTimeHTTP/2:Multiplexingimage.
jpgstyles.
cssdata.
xmlimage.
jpgstyles.
cssdata.
xmlHTTP/1.
1:Head-of-LineBlocking(withPipelining)PriorityLegendLowMediumHighHTTP/1.
1HTTP/2MultipleTCPconnectionstoahostOnlyoneTCPconnectionHead-of-lineblockingFullymultiplexedFIFOrestrictionsRequestshaveprioritiesHTTP/1.
1HTTP/2MultipleTCPconnectionstoahostOnlyoneTCPconnectionHead-of-lineblockingFullymultiplexedFIFOrestrictionsRequestshaveprioritiesTextualprotocoloverheadBinaryHTTP/1.
1HTTP/2MultipleTCPconnectionstoahostOnlyoneTCPconnectionHead-of-lineblockingFullymultiplexedFIFOrestrictionsRequestshaveprioritiesTextualprotocoloverheadBinaryNoheadercompressionHeadercompression(HPACK)IndexHeaderNameHeaderValue-HTTP/2HeaderCompressionIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateHPACKStaticTableDynamicTableIndexHeaderNameHeaderValue-HTTP/2HeaderCompressionHPACKStaticTableIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateDynamicTableIndexHeaderNameHeaderValue-HTTP/2HeaderCompressionHPACKStaticTableIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateDynamicTableGET/HTTP/1.
1\r\nHost:www.
example.
com\r\nConnection:Keep-Alive\r\n\r\nHTTP/1.
1Request:IndexHeaderNameHeaderValue-HTTP/2HeaderCompressionHPACKStaticTableIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateDynamicTable:method:GET:scheme:https:path:/:authority:www.
example.
comHTTP/2Representation:GET/HTTP/1.
1\r\nHost:www.
example.
com\r\nConnection:Keep-Alive\r\n\r\nHTTP/1.
1Request:IndexHeaderNameHeaderValue-HTTP/2HeaderCompressionHPACKStaticTableIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateDynamicTable:method:GET:scheme:https:path:/:authority:www.
example.
comHTTP/2Representation:GET/HTTP/1.
1\r\nHost:www.
example.
com\r\nConnection:Keep-Alive\r\n\r\nHTTP/1.
1Request:IndexHeaderNameHeaderValue-HTTP/2HeaderCompressionHPACKStaticTableIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateDynamicTable:method:GET:scheme:https:path:/:authority:www.
example.
comHTTP/2Representation:GET/HTTP/1.
1\r\nHost:www.
example.
com\r\nConnection:Keep-Alive\r\n\r\nHTTP/1.
1Request:IndexHeaderNameHeaderValue-HTTP/2HeaderCompressionHPACKStaticTableIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateDynamicTable:method:GET:scheme:https:path:/:authority:www.
example.
comHTTP/2Representation:GET/HTTP/1.
1\r\nHost:www.
example.
com\r\nConnection:Keep-Alive\r\n\r\nHTTP/1.
1Request:IndexHeaderNameHeaderValue-HTTP/2HeaderCompressionHPACKStaticTableIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateDynamicTable:method:GET:scheme:https:path:/:authority:www.
example.
comHTTP/2Representation:GET/HTTP/1.
1\r\nHost:www.
example.
com\r\nConnection:Keep-Alive\r\n\r\nHTTP/1.
1Request:IndexHeaderNameHeaderValue-HTTP/2HeaderCompressionIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticate:method:GET:scheme:https:path:/:authority:www.
example.
comHTTP/2Representation:GET/HTTP/1.
1\r\nHost:www.
example.
com\r\nConnection:Keep-Alive\r\n\r\nHTTP/1.
1Request:HPACKStaticTableDynamicTableIndexHeaderNameHeaderValue-HTTP/2HeaderCompressionIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticate:method:GET:scheme:https:path:/:authority:www.
example.
comHTTP/2Representation:GET/HTTP/1.
1\r\nHost:www.
example.
com\r\nConnection:Keep-Alive\r\n\r\nHTTP/1.
1Request:www.
example.
comHPACKStaticTableDynamicTableIndexHeaderNameHeaderValue1:authoritywww.
example.
comHTTP/2HeaderCompressionIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateHPACKStaticTableDynamicTableIndexHeaderNameHeaderValue1:authoritywww.
example.
comHTTP/2HeaderCompressionIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateHPACKStaticTableDynamicTableIndexHeaderNameHeaderValue1:authoritywww.
example.
comHTTP/2HeaderCompressionIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateGET/index.
htmlHTTP/1.
1\r\nHost:www.
example.
com\r\nConnection:Keep-Alive\r\n\r\nHTTP/1.
1Secondrequest:HPACKStaticTableDynamicTableIndexHeaderNameHeaderValue1:authoritywww.
example.
comHTTP/2HeaderCompressionIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateGET/index.
htmlHTTP/1.
1\r\nHost:www.
example.
com\r\nConnection:Keep-Alive\r\n\r\nHTTP/1.
1Secondrequest:HTTP/2Secondrequest::method:GET:scheme:https:path:/index.
html:authority:www.
example.
comHPACKStaticTableDynamicTableIndexHeaderNameHeaderValue1:authoritywww.
example.
comHTTP/2HeaderCompressionIndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.
html6:schemehttp7:schemehttps8:status200……14:status50015accept-charset16accept-encodinggzip,deate17accept-language……57transfer-encoding58user-agent59vary60via61www-authenticateGET/index.
htmlHTTP/1.
1\r\nHost:www.
example.
com\r\nConnection:Keep-Alive\r\n\r\nHTTP/1.
1Secondrequest:HTTP/2Secondrequest:HPACKStaticTableDynamicTableHTTP/2AdoptionontheclientNSURLSessionsupportsHTTP/2protocolautomaticallyHTTP/2AdoptionontheclientNSURLSessionsupportsHTTP/2protocolautomaticallyNosourcecodechangesneededHTTP/2AdoptionontheclientNSURLSessionsupportsHTTP/2protocolautomaticallyNosourcecodechangesneededHTTP/2AdoptionontheclientletsessionConfig=NSURLSessionConfiguration.
defaultSessionConfiguration()letsession=NSURLSession(configuration:sessionConfig)leturl=NSURL(string:"https://www.
example.
com")!
lettask=session.
dataTaskWithURL(url){(data:NSData,response:NSURLResponse,error:NSError)in.
.
.
}task.
resume()YouOnlyNeedanHTTP/2ServerHTTP/2inNSURLSessionCompatibilityBackwardcompatiblewithHTTP/1.
1serversEncryptedconnectiononlyHTTP/2serverrequiresALPNorNPNsupportHTTP/2TodayCurrentadoptionHomeKitRemoteAccessviaiCloudServicesprovidedbyGoogleandTwitterOpensourcewebserversContentDeliveryNetworkprovidersHTTP/2AtaglanceHTTP/2isavailableinWWDCseedtodayAvailableinNSURLSessionEnabledinSafarionOSX10.
11andiOS9NSURLSessiononwatchOSDanVinegradSoftwareEngineerNSURLSessiononwatchOSFullysupportedforHTTP(S)Usesbestavailableconnectivity(iPhoneorWiFi)NSURLSessiononwatchOSFullysupportedforHTTP(S)Usesbestavailableconnectivity(iPhoneorWiFi)It'sMagicNSURLSessiononwatchOSBestpracticesNSURLSessiononwatchOSBestpracticesDownloadtheminimalassetsrequiredSmallscreenLimitedbandwidthNSURLSessiononwatchOSBestpracticesDownloadtheminimalassetsrequiredSmallscreenLimitedbandwidthAppswillonlyrunforaveryshorttimeSendsmallamountsofdataUsebackgrounduploads/downloadsforlargercontentAPIChangesNSURLConnectionNSURLConnectionDeprecatedinOSX10.
11andiOS9.
0Notgoingaway,appsusingitwillstillworkNewfeatureswillbeaddedtoNSURLSessionNotsupportedonwatchOSSwitchingtoNSURLSessioniseasySwitchingtoNSURLSessionletqueue:NSOperationQueue=.
.
.
leturl=NSURL(string:"https://www.
example.
com")!
letrequest=NSURLRequest(URL:url)NSURLConnection.
sendAsynchronousRequest(request,queue:queue){(response:NSURLResponse,data:NSData,error:NSError)in.
.
.
}SwitchingtoNSURLSessionletqueue:NSOperationQueue=.
.
.
leturl=NSURL(string:"https://www.
example.
com")!
letrequest=NSURLRequest(URL:url)NSURLConnection.
sendAsynchronousRequest(request,queue:queue){(response:NSURLResponse,data:NSData,error:NSError)in.
.
.
}lettask=NSURLSession.
sharedSession().
dataTaskWithRequest(request){(data:NSData,response:NSURLResponse,error:NSError)in.
.
.
}task.
resume()NewNSURLSessionAPISharingCookiesBetweenAppsandExtensionsAppsandtheirextensionshavedierentcookiestoragesbydefaultCanuseapplicationgroupstogetashareddatacontainerOSX10.
11andiOS9introducenewAPItocreateasharedcookiestorageNewNSHTTPCookieStorageAPIletident="group.
mycompany.
mygroupname"letcookieStorage=NSHTTPCookieStorage.
sharedCookieStorageForGroupContainerIdentifier(identifier:ident)letconfig=NSURLSessionConfiguration.
defaultSessionConfiguration()config.
HTTPCookieStorage=cookieStorageletsession=NSURLSession(configuration:config)NSURLSessionStreamTaskTCP/IPnetworkingNSURLSessionStreamTaskTCP/IPnetworkingSometimesneedaprotocolotherthanHTTP(S)NSURLSessionStreamTaskTCP/IPnetworkingSometimesneedaprotocolotherthanHTTP(S)AdvantagesoverNSInputStream/NSOutputStreamAsynchronousread/writeinterfaceCanautomaticallygetthroughHTTPproxiesNewAPIgoodiesNSURLSessionStreamTaskTCP/IPnetworkingSometimesneedaprotocolotherthanHTTP(S)AdvantagesoverNSInputStream/NSOutputStreamAsynchronousread/writeinterfaceCanautomaticallygetthroughHTTPproxiesNewAPIgoodiesLegacyNSStreamsupportNSURLSessionStreamTaskTCP/IPnetworkingNSURLSessionStreamTaskTCP/IPnetworkingSupportsTCP/IPconnections:HostnameandportNSNetServiceresolutionNSURLSessionStreamTaskTCP/IPnetworkingSupportsTCP/IPconnections:HostnameandportNSNetServiceresolutionUsesexistingNSURLSessioncongurationandsessiondelegatesNSURLSessionStreamTaskTCP/IPnetworkingSupportsTCP/IPconnections:HostnameandportNSNetServiceresolutionUsesexistingNSURLSessioncongurationandsessiondelegatesSecureTLSconnectionssupportedEvenafterconnected!
NSURLSessionStreamTaskAsynchronousreadlettask=NSURLSession.
sharedSession().
streamTaskWithHostName("chat.
example.
com",port:5555)!
task.
resume()task.
readDataOfMinLength(16384,maxLength:65536,timeout:30.
0){(data:NSData,eof:Bool,error:NSError)in.
.
.
}NSURLSessionStreamTaskAsynchronouswritelettask=NSURLSession.
sharedSession().
streamTaskWithHostName("chat.
example.
com",port:5555)!
task.
resume()letdata:NSData=.
.
.
task.
writeData(data,timeout:30.
0){(error:NSError)in.
.
.
}NSURLSessionStreamTaskEnablingTLSlettask=NSURLSession.
sharedSession().
streamTaskWithHostName("chat.
example.
com",port:5555)!
task.
startSecureConnection()task.
resume()letdata:NSData=.
.
.
task.
writeData(data,timeout:30.
0){(error:NSError)in.
.
.
}NSURLSessionStreamTaskConversiontoNSStreamsNSURLSessionStreamTaskConversiontoNSStreamsSomeexistingAPIsconsumeNSStreamobjectsNSURLSessionStreamTaskConversiontoNSStreamsSomeexistingAPIsconsumeNSStreamobjectsPendingreads/writescompletebeforeNSStreamsareproducedNSURLSessionStreamTaskConversiontoNSStreamsSomeexistingAPIsconsumeNSStreamobjectsPendingreads/writescompletebeforeNSStreamsareproducedDetachesthetaskfromthesessionNSURLSessionStreamTaskNSStreamsupportletstreamTask:NSURLSessionStreamTask=…streamTask.
captureStreams()NSURLSessionStreamTaskNSStreamsupportfuncURLSession(session:NSURLSession,streamTask:NSURLSessionStreamTask,didBecomeInputStreaminputStream:NSInputStream,outputStream:NSOutputStream){//CanpassinputStream/outputStreamtoAPIsthatconsumeNSStreams}NSURLSessionStreamTaskOther(informational)delegatemethodsoptionalfuncURLSession(session:NSURLSession,betterRouteDiscoveredForStreamTaskstreamTask:NSURLSessionStreamTask)NSURLSessionStreamTaskOther(informational)delegatemethodsoptionalfuncURLSession(session:NSURLSession,betterRouteDiscoveredForStreamTaskstreamTask:NSURLSessionStreamTask)optionalfuncURLSession(session:NSURLSession,readClosedForStreamTaskstreamTask:NSURLSessionStreamTask)optionalfuncURLSession(session:NSURLSession,writeClosedForStreamTaskstreamTask:NSURLSessionStreamTask)NSURLSessionStreamTaskDataTaskconversionNSURLSessionStreamTaskDataTaskconversionNSURLSessionDataTaskmaybeconvertedtoastreamtaskUseNSURLSessiontogetthroughHTTPproxiesNSURLSessionStreamTaskDataTaskconversionNSURLSessionDataTaskmaybeconvertedtoastreamtaskUseNSURLSessiontogetthroughHTTPproxiesConversioncanoccurwhenresponseisreceivedNSURLSessionStreamTaskDataTaskconversionfuncURLSession(session:NSURLSession,dataTask:NSURLSessionDataTask,didReceiveResponseresponse:NSURLResponse,completionHandler:(NSURLSessionResponseDisposition)->Void){completionHandler(.
BecomeStream)}funcURLSession(session:NSURLSession,dataTask:NSURLSessionDataTask,didBecomeStreamTaskstreamTask:NSURLSessionStreamTask){}SummaryAppTransportSecurityHTTP/2supportinNSURLSessionNSURLSessiononwatchOSNSURLConnectiondeprecationNewAPIGroupcontainercookiestoragesNSURLSessionStreamTaskMoreInformationDocumentationDeveloperResourceshttps://developer.
apple.
comTechnicalSupportAppleDeveloperForumshttp://devforums.
apple.
comDeveloperTechnicalSupporthttp://developer.
apple.
com/support/technicalGeneralInquiriesPaulDanbold,CoreOSEvangelistdanbold@apple.
comRelatedSessionsSecurityandYourAppsMissionTuesday4:30PMIntroducingWatchConnectivityPacicHeightsThursday11:00AMYourAppandNextGenerationNetworksMissionFriday11:00AMRelatedLabsNetworkingLabFrameworksLabEThursday10:00AMNetworkingLabFrameworksLabBFriday1:30PM
飞讯云官网“飞讯云”是湖北飞讯网络有限公司旗下的云计算服务品牌,专注为个人开发者用户、中小型、大型企业用户提供一站式核心网络云端部署服务,促使用户云端部署化简为零,轻松快捷运用云计算。飞讯云是国内为数不多具有ISP/IDC双资质的专业云计算服务商,同时持有系统软件著作权证书、CNNIC地址分配联盟成员证书,通过了ISO27001信息安全管理体系国际认证、ISO9001质量保证体系国际认证。 《中华...
ZJI是成立于2011年原Wordpress圈知名主机商—维翔主机,2018年9月更名为ZJI,主要提供香港、日本、美国独立服务器(自营/数据中心直营)租用及VDS、虚拟主机空间、域名注册业务。本月商家针对香港阿里云线路独立服务器提供月付立减270-400元优惠码,优惠后香港独立服务器(阿里云专线)E3或者E5 CPU,SSD硬盘,最低每月仅480元起。阿里一型CPU:Intel E5-2630L...
pia云怎么样?pia云是一家2018的开办的国人商家,原名叫哔哔云,目前整合到了魔方云平台上,商家主要销售VPS服务,采用KVM虚拟架构 ,机房有美国洛杉矶、中国香港和深圳地区,洛杉矶为crea机房,三网回程CN2 GIA,带20G防御。目前,Pia云优惠促销,年付全场8折起,香港超极速CN2季付活动,4核4G15M云服务器仅240元/季起,香港CN2、美国三网CN2深圳BGP优质云服务器超高性...
acceptencoding为你推荐
pcllenchrome蓝牙itunes汉语163solutionssbnetbios端口如何组织netbios端口的外部通信win7关闭445端口如何快速关闭445端口ipad上网为什么我的ipad 显示无法连接到网络用itunes备份如何用iTunes备份iPhone数据ms17-010win10华为 slatl10是什么型号iphonewifi苹果手机突然用不了Wi-Fi了
全能虚拟主机 北京租服务器 pw域名 wdcp seovip 警告本网站 美国十次啦服务器 100x100头像 shopex主机 web服务器搭建 智能dns解析 lamp架构 网页加速 双十二促销 hdchina 香港ip 美国主机 美国十大啦 server2008 so域名 更多