/iPhoneSample/Frameworks/FSKit.framework/Versions/A/Headers/SimpleHTTPServer.h

http://fskit.googlecode.com/ · C Header · 44 lines · 23 code · 10 blank · 11 comment · 0 complexity · fafb155667a927f619e6aacda232c719 MD5 · raw file

  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. #import <Foundation/Foundation.h>
  11. @class SimpleHTTPConnection;
  12. @interface SimpleHTTPServer : NSObject {
  13. unsigned port;
  14. id delegate;
  15. NSSocketPort *socketPort;
  16. NSFileHandle *fileHandle;
  17. NSMutableArray *connections;
  18. NSMutableArray *requests;
  19. NSDictionary *currentRequest;
  20. }
  21. - (id)initWithTCPPort:(unsigned)po delegate:(id)dl;
  22. - (NSArray *)connections;
  23. - (NSArray *)requests;
  24. - (void)closeConnection:(SimpleHTTPConnection *)connection;
  25. - (void)newRequestWithURL:(NSURL *)url connection:(SimpleHTTPConnection *)connection;
  26. // Request currently being processed
  27. // Note: this need not be the most recently received request
  28. - (NSDictionary *)currentRequest;
  29. - (void)replyWithStatusCode:(int)code
  30. headers:(NSDictionary *)headers
  31. body:(NSData *)body;
  32. - (void)replyWithData:(NSData *)data MIMEType:(NSString *)type;
  33. - (void)replyWithStatusCode:(int)code message:(NSString *)message;
  34. @end