//
//  ResponseHandler.h
//  CyTV
//
//  Created by Andreas Junghans on 29.12.07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "AsyncSocket.h"


@interface ResponseHandler : NSObject {
	CFHTTPMessageRef _request;
    NSURL *_uri;
    NSString *_method;
    NSString *_path;
    NSString *_query;
    NSDictionary *_paramsDict;
    AsyncSocket *_asyncSocket;
}

- (void)setRequest:(CFHTTPMessageRef)request;
- (void)setURI:(NSURL *)uri;
- (void)setMethod:(NSString *)method;
- (void)setPath:(NSString *)path;
- (void)setQuery:(NSString *)query;
- (void)setParamsDict:(NSDictionary *)paramsDict;
- (void)setAsyncSocket:(AsyncSocket *)asyncSocket;

- (void)handleRequest;
- (void)onSocketCanWrite:(AsyncSocket *)sock;

- (void)shutDownAndRelease;

+ (void)writeResponseWithCode:(int)statusCode content:(NSString *)content socket:(AsyncSocket *)socket timeout:(NSTimeInterval)timeout;

@end
