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
DiyVM是一家成立于2009年的国人主机商,提供的产品包括VPS主机、独立服务器租用等,产品数据中心包括中国香港、日本大阪和美国洛杉矶等,其中VPS主机基于XEN架构,支持异地备份与自定义镜像,VPS和独立服务器均可提供内网IP功能。商家VPS主机均2GB内存起步,三个地区机房可选,使用优惠码后每月69元起;独立服务器开设在香港沙田电信机房,CN2线路,自动化开通上架,最低499元/月起。下面以...
搬瓦工今天正式对外开卖荷兰阿姆斯特丹机房走联通AS9929高端线路的VPS,官方标注为“NL - China Unicom Amsterdam(ENUL_9)”,三网都走联通高端网络,即使是在欧洲,国内访问也就是飞快。搬瓦工的依旧是10Gbps带宽,可以在美国cn2 gia、日本软银与荷兰AS9929之间免费切换。官方网站:https://bwh81.net优惠码:BWH3HYATVBJW,节约6...
digital-vm怎么样?digital-vm在今年1月份就新增了日本、新加坡独立服务器业务,但是不知为何,期间终止了销售日本服务器和新加坡服务器,今天无意中在webhostingtalk论坛看到Digital-VM在发日本和新加坡独立服务器销售信息。服务器硬件是 Supermicro、采用最新一代 Intel CPU、DDR4 RAM 和 Enterprise Samsung SSD内存,默认...
acceptencoding为你推荐
福建海峡银行股份有限公司!圈i申国电子政务发展调查报告http://www.paper.edu.cn存在问题的应用软件名单(2020年第四批)支持ipad阿片类药物:您需要知道什么支持ipadtcpip上的netbios网络连接详细信息上的netbios over tcpip是什么意思?win7telnetwindows7旗舰版中telnet在哪x-router设置路由器是我的上网设置是x怎么弄
重庆vps租用 过期域名抢注 阿云浏览器 踢楼 私服服务器 鲜果阅读 国内加速器 web服务器架设软件 镇江联通宽带 卡巴斯基永久免费版 空间合租 绍兴电信 免费个人主页 实惠 umax 石家庄服务器 tracker服务器 winds winserver2008r2 winserver2008下载 更多