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
主机参考最新消息:JustHost怎么样?JustHost服务器好不好?JustHost好不好?JustHost是一家成立于2006年的俄罗斯服务器提供商,支持支付宝付款,服务器价格便宜,200Mbps大带宽不限流量,支持免费更换5次IP,支持控制面板自由切换机房,目前JustHost有俄罗斯5个机房可以自由切换选择,最重要的还是价格真的特别便宜,最低只需要87卢布/月,约8.5元/月起!just...
georgedatacenter怎么样?georgedatacenter这次其实是两个促销,一是促销一款特价洛杉矶E3-1220 V5独服,性价比其实最高;另外还促销三款特价vps,大家可以根据自己的需要入手。georgedatacenter是一家成立于2019年的美国vps商家,主营美国洛杉矶、芝加哥、达拉斯、新泽西、西雅图机房的VPS、邮件服务器和托管独立服务器业务。georgedatacen...
今天中午的时候有网友联系到在选择网站域名建站和主机的时候问到域名和IP地址有没有关联,或者需要注意的问题。毕竟我们在需要建站的时候,我们需要选择网站域名和主机,而主机有虚拟主机,包括共享和独立IP,同时还有云服务器、独立服务器、站群服务器等形式。通过这篇文章,简单的梳理关于网站域名和IP之间的关系。第一、什么是域名所谓网站域名,就是我们看到的类似"www.laozuo.org",我们可以通过直接记...
acceptencoding为你推荐
甘肃省武威市人民检察院技术检验鉴定http://www.tutorialspoint.com/css/css_dimension.htm步骤iosiphone连不上wifi苹果手机“无法加入网络”怎么办itunes备份itunes 里面的资料如何备份?ipad上网ipad上网速度很慢怎么回事?ms17-010win1038度古贝春珍藏10价格?googleadsense我申请Google AdSense要怎样才能通过Google AdSense呀?win7还原系统windows7怎么还原系统啊morphvoxpro怎么用如何使用MorphVOX Pro变声
播放vps上的视频 二级域名申请 中国域名网 已经备案域名 骨干网 vir 美国php主机 万网优惠券 帽子云 空间论坛 腾讯实名认证中心 万网空间购买 中国电信网络测速 韩国代理ip 德讯 免费蓝钻 金主 国外网页代理 hostease 深圳主机托管 更多