/iPhoneSample/Frameworks/FSKit.framework/Versions/A/Headers/SimpleHTTPServer.h
C Header | 44 lines | 23 code | 10 blank | 11 comment | 0 complexity | fafb155667a927f619e6aacda232c719 MD5 | raw file
Possible License(s): BSD-3-Clause
1// 2// SimpleHTTPServer.h 3// Web2PDF Server 4// 5// Created by J?rgen on 19.09.06. 6// Copyright 2006 Cultured Code. 7// License: Creative Commons Attribution 2.5 License 8// http://creativecommons.org/licenses/by/2.5/ 9// 10 11#import <Foundation/Foundation.h> 12 13@class SimpleHTTPConnection; 14 15@interface SimpleHTTPServer : NSObject { 16 unsigned port; 17 id delegate; 18 19 NSSocketPort *socketPort; 20 NSFileHandle *fileHandle; 21 NSMutableArray *connections; 22 NSMutableArray *requests; 23 NSDictionary *currentRequest; 24} 25 26- (id)initWithTCPPort:(unsigned)po delegate:(id)dl; 27 28- (NSArray *)connections; 29- (NSArray *)requests; 30 31- (void)closeConnection:(SimpleHTTPConnection *)connection; 32- (void)newRequestWithURL:(NSURL *)url connection:(SimpleHTTPConnection *)connection; 33 34// Request currently being processed 35// Note: this need not be the most recently received request 36- (NSDictionary *)currentRequest; 37 38- (void)replyWithStatusCode:(int)code 39 headers:(NSDictionary *)headers 40 body:(NSData *)body; 41- (void)replyWithData:(NSData *)data MIMEType:(NSString *)type; 42- (void)replyWithStatusCode:(int)code message:(NSString *)message; 43 44@end