MCONNTPSession Class Reference
| Inherits from | NSObject |
| Declared in | MCONNTPSession.h MCONNTPSession.mm |
Tasks
Other Methods
-
hostnameproperty -
portproperty -
usernameproperty -
passwordproperty -
connectionTypeproperty -
timeoutproperty -
checkCertificateEnabledproperty -
connectionLoggerproperty -
dispatchQueueproperty -
operationQueueRunningproperty -
operationQueueRunningChangeBlockproperty -
– cancelAllOperations
Operations
-
– fetchAllArticlesOperation: -
– fetchHeaderOperationWithIndex:inGroup: -
– fetchOverviewOperationWithIndexes:inGroup: -
– fetchArticleOperationWithIndex:inGroup: -
– fetchArticleOperationWithMessageID:inGroup: -
– fetchServerDateOperation -
– listAllNewsgroupsOperation -
– listDefaultNewsgroupsOperation -
– disconnectOperation -
– checkAccountOperation
Properties
checkCertificateEnabled
When set to YES, the connection will fail if the certificate is incorrect.
@property (nonatomic, assign, getter=isCheckCertificateEnabled) BOOL checkCertificateEnabledDeclared In
MCONNTPSession.hconnectionLogger
Sets logger callback. The network traffic will be sent to this block.
@property (nonatomic, copy) MCOConnectionLogger connectionLoggerDiscussion
[session setConnectionLogger:^(void * connectionID, MCOConnectionLogType type, NSData * data) { }];
Declared In
MCONNTPSession.hconnectionType
This is the encryption type to use. See MCOConnectionType for more information.
@property (nonatomic, assign) MCOConnectionType connectionTypeDeclared In
MCONNTPSession.hdispatchQueue
This property provides some hints to MCONNTPSession about where it’s called from. It will make MCONNTPSession safe. It will also set all the callbacks of operations to run on this given queue. Defaults to the main queue. This property should be used only if there’s performance issue using MCONNTPSession in the main thread.
@property (nonatomic, retain) dispatch_queue_t dispatchQueueDeclared In
MCONNTPSession.hhostname
This is the hostname of the NNTP server to connect to.
@property (nonatomic, copy) NSString *hostnameDeclared In
MCONNTPSession.hoperationQueueRunning
The value will be YES when asynchronous operations are running, else it will return NO.
@property (nonatomic, assign, readonly, getter=isOperationQueueRunning) BOOL operationQueueRunningDeclared In
MCONNTPSession.hoperationQueueRunningChangeBlock
Sets operation running callback. It will be called when operations start or stop running.
@property (nonatomic, copy) MCOOperationQueueRunningChangeBlock operationQueueRunningChangeBlockDiscussion
[session setOperationQueueRunningChangeBlock:^{ if ([session isOperationQueueRunning]) { } else { } }];
Declared In
MCONNTPSession.hpassword
This is the password of the account.
@property (nonatomic, copy) NSString *passwordDeclared In
MCONNTPSession.hport
This is the port of the NNTP server to connect to.
@property (nonatomic, assign) unsigned int portDeclared In
MCONNTPSession.hInstance Methods
checkAccountOperation
Returns an operation that will check whether the NNTP account is valid.
- (MCONNTPOperation *)checkAccountOperationDiscussion
MCONNTPOperation * op = [session checkAccountOperation]; [op start:^(NSError * error) { }];
Declared In
MCONNTPSession.hdisconnectOperation
Returns an operation that will disconnect the session.
- (MCONNTPOperation *)disconnectOperationDiscussion
MCONNTPOperation * op = [session disconnectOperation]; [op start:^(NSError * error) { }];
Declared In
MCONNTPSession.hfetchAllArticlesOperation:
Returns an operation that will fetch the list of article numbers.
- (MCONNTPFetchAllArticlesOperation *)fetchAllArticlesOperation:(NSString *)groupDiscussion
MCONNTPFetchAllArticlesOperation * op = [session fetchAllArticlesOperation:@“comp.lang.c”]; [op start:^(NSError * error, MCOIndexSet * articles) { }];
Declared In
MCONNTPSession.hfetchArticleOperationWithIndex:inGroup:
Returns an operation that will fetch the content of the given message.
- (MCONNTPFetchArticleOperation *)fetchArticleOperationWithIndex:(unsigned int)index inGroup:(NSString *)groupDiscussion
MCONNTPFetchArticleOperation * op = [session fetchArticleOperationWithIndex:idx inGroup:@“comp.lang.c”]; [op start:^(NSError * error, NSData * messageData) { // messageData is the RFC 822 formatted message data. }];
Declared In
MCONNTPSession.hfetchArticleOperationWithMessageID:inGroup:
Returns an operation that will fetch the content of a message with the given messageID.
- (MCONNTPFetchArticleOperation *)fetchArticleOperationWithMessageID:(NSString *)messageID inGroup:(NSString *)groupDiscussion
MCONNTPFetchArticleOperation * op = [session fetchArticleOperationWithMessageID:@“MessageID123@mail.google.com” inGroup:@“comp.lang.c”]; [op start:^(NSError * error, NSData * messageData) { // messageData is the RFC 822 formatted message data. }];
Declared In
MCONNTPSession.hfetchHeaderOperationWithIndex:inGroup:
Returns an operation that will fetch the header of the given message.
- (MCONNTPFetchHeaderOperation *)fetchHeaderOperationWithIndex:(unsigned int)index inGroup:(NSString *)groupDiscussion
MCONNTPFetchHeaderOperation * op = [session fetchHeaderOperationWithIndex:idx inGroup:@“comp.lang.c”]; [op start:^(NSError * error, MCOMessageHeader * header) { // header is the parsed header of the message. }];
Declared In
MCONNTPSession.hfetchOverviewOperationWithIndexes:inGroup:
Returns an operation that will fetch an overview (headers) for a set of messages.
- (MCONNTPFetchOverviewOperation *)fetchOverviewOperationWithIndexes:(MCOIndexSet *)indexes inGroup:(NSString *)groupDiscussion
MCONNTPFetchHeaderOperation * op = [session fetchOverviewOperationWithIndexes:indexes inGroup:@“comp.lang.c”]; [op start:^(NSError * error, NSArray * headers) { // headers are the parsed headers of each part of the overview. }];
Declared In
MCONNTPSession.hfetchServerDateOperation
Returns an operation that will fetch the server’s date and time.
- (MCONNTPFetchServerTimeOperation *)fetchServerDateOperationDiscussion
MCONNTPFetchArticleOperation * op = [session fetchServerDateOperation]; [op start:^(NSError * error, NSDate * serverDate) { }];
Declared In
MCONNTPSession.hlistAllNewsgroupsOperation
Returns an operation that will list all available newsgroups.
- (MCONNTPListNewsgroupsOperation *)listAllNewsgroupsOperationDiscussion
MCONNTPListNewsgroupsOperation * op = [session listAllNewsgroupsOperation]; [op start:^(NSError * error, NSArray * subscribedGroups) { }];
Declared In
MCONNTPSession.hlistDefaultNewsgroupsOperation
Returns an operation that will list server-suggested default newsgroups.
- (MCONNTPListNewsgroupsOperation *)listDefaultNewsgroupsOperationDiscussion
MCONNTPListNewsgroupsOperation * op = [session listDefaultNewsgroupsOperation]; [op start:^(NSError * error, NSArray * defaultGroups) { }];
Declared In
MCONNTPSession.h