BLIP/BLIPReader.h
author Jens Alfke <jens@mooseyard.com>
Fri Jul 24 14:06:28 2009 -0700 (2009-07-24)
changeset 63 5e4855a592ee
parent 11 29e8b03c05d4
permissions -rw-r--r--
* The BLIPConnection receivedRequest: delegate method now returns BOOL. If the method returns NO (or if the method isn't implemented in the delegate), that means it didn't handle the message at all; an error will be returned to the sender.
* If the connection closes unexpectedly due to an error, then the auto-generated responses to pending requests will contain that error. This makes it easier to display a meaningful error message in the handler for the request.
jens@0
     1
//
jens@0
     2
//  BLIPReader.h
jens@0
     3
//  MYNetwork
jens@0
     4
//
jens@0
     5
//  Created by Jens Alfke on 5/10/08.
jens@0
     6
//  Copyright 2008 Jens Alfke. All rights reserved.
jens@0
     7
//
jens@0
     8
jens@0
     9
#import "TCPStream.h"
jens@0
    10
#import "BLIP_Internal.h"
jens@0
    11
@class BLIPResponse;
jens@0
    12
jens@0
    13
jens@0
    14
/** INTERNAL class that reads BLIP frames from the socket. */
jens@0
    15
@interface BLIPReader : TCPReader
jens@0
    16
{
jens@26
    17
    @private
jens@0
    18
    BLIPFrameHeader _curHeader;
jens@0
    19
    UInt32 _curBytesRead;
jens@0
    20
    NSMutableData *_curBody;
jens@0
    21
jens@11
    22
    UInt32 _numRequestsReceived;
jens@11
    23
    NSMutableDictionary *_pendingRequests, *_pendingResponses;
jens@0
    24
}
jens@0
    25
jens@0
    26
- (void) _addPendingResponse: (BLIPResponse*)response;
jens@0
    27
jens@0
    28
@end