CURLHandle Class Reference
| Inherits from | NSObject |
| Declared in | CURLHandle.h |
Overview
Wrapper for a CURL easy handle.
Private API used by CURLMulti. Not exported in the framework, and not recommended for general use.
This functionality is only provided for unit tests, and isn’t intended for general use. It is included in the framework, so that frameworks that build on this one (eg ConnectionKit) can use these functions in their unit tests.
Tasks
Other Methods
-
– cancelStops the request — and delivery of delegate messages — as quickly as possible
-
– initialFTPPathCURLINFO_FTP_ENTRY_PATH. Only suitable once handle has finished.
Internal Methods from MultiSupport
-
– curlThe CURL handle managed by this object.
-
– completeWithCode:isMulti:Called by CURLMulti to tell the handle that it has completed.
-
– hasCompletedHas the handle completed?
-
– removedByMulti:Called by CURLMulti when it stops managing the handle.
Testing Methods from TestingSupport
-
– isCancelledHas cancel been called on this handle?
-
– handledByMultiIs this handle managed by a multi?
-
+ standaloneMultiForTestPurposesReturns a new CURLMulti, for use in testing.
-
+ cleanupStandaloneMulti:Clean up a multi that was created by standaloneMultiForTestPurposes.
Synchronous Methods from OldAPI
-
– sendSynchronousRequest:credential:delegate:Perform a request synchronously.
Class Methods
cleanupStandaloneMulti:
Clean up a multi that was created by standaloneMultiForTestPurposes.
+ (void)cleanupStandaloneMulti:(CURLMulti *)multiParameters
- multi
The multi to clean up.
Discussion
Warning: Not intended for general use.
Declared In
CURLHandle+TestingSupport.hstandaloneMultiForTestPurposes
Returns a new CURLMulti, for use in testing.
+ (CURLMulti *)standaloneMultiForTestPurposesReturn Value
A new CURLMulti object.
Discussion
Generally multi’s are an internal implementation detail, but it’s useful to be able to make new ones for unit tests since sharing multis between tests can create dependencies.
Warning: Not intended for general use.
Declared In
CURLHandle+TestingSupport.hInstance Methods
cancel
Stops the request — and delivery of delegate messages — as quickly as possible
- (void)cancelDeclared In
CURLHandle.hcompleteWithCode:isMulti:
Called by CURLMulti to tell the handle that it has completed.
- (void)completeWithCode:(NSInteger)code isMulti:(BOOL)isMultiCodeParameters
- code
The completion code.
- isMultiCode
Is the code a result from the handle itself, or the multi managing it?
Discussion
Warning: Not intended for general use.
Declared In
CURLHandle+MultiSupport.hcurl
The CURL handle managed by this object.
- (CURL *)curlReturn Value
The curl handle.
Discussion
Warning: Not intended for general use.
Declared In
CURLHandle+MultiSupport.hhandledByMulti
Is this handle managed by a multi?
- (BOOL)handledByMultiReturn Value
YES if the handle is managed by a multi.
Discussion
Warning: Not intended for general use.
Declared In
CURLHandle+TestingSupport.hhasCompleted
Has the handle completed?
- (BOOL)hasCompletedReturn Value
YES if the handle has completed.
Discussion
Warning: Not intended for general use.
Declared In
CURLHandle+MultiSupport.hinitialFTPPath
CURLINFO_FTP_ENTRY_PATH. Only suitable once handle has finished.
- (NSString *)initialFTPPathReturn Value
The value of CURLINFO_FTP_ENTRY_PATH.
Declared In
CURLHandle.hisCancelled
Has cancel been called on this handle?
- (BOOL)isCancelledReturn Value
YES if the handle has been cancelled.
Discussion
Warning: Not intended for general use.
Declared In
CURLHandle+TestingSupport.hremovedByMulti:
Called by CURLMulti when it stops managing the handle.
- (void)removedByMulti:(CURLMulti *)multiParameters
- multi
The multi object that was managing this handle.
Discussion
Warning: Not intended for general use.
Declared In
CURLHandle+MultiSupport.hsendSynchronousRequest:credential:delegate:
Perform a request synchronously.
- (void)sendSynchronousRequest:(NSURLRequest *)request credential:(NSURLCredential *)credential delegate:(id<CURLHandleDelegate>)delegateParameters
- request
The request to perform.
- credential
A credential to use for the request.
- delegate
An object to use as the delegate.
Discussion
Please don’t use this unless you have to! To use, -init a handle, and then call this method, as many times as you like. Delegate messages will be delivered fairly normally during the request To cancel a synchronous request, call -cancel on a different thread and this method will return as soon as it can
Declared In
CURLHandle.h