Differences From Artifact [e4f4f862dd]:
- File
src/OFHTTPServer.h
— part of check-in
[75f187cef5]
at
2012-12-26 20:55:27
on branch trunk
— OFHTTPRequestResult -> OFHTTPRequestReply.
The class also has its own file now. (user: js, size: 3333) [annotate] [blame] [check-ins using]
To Artifact [0320d9c75b]:
- File
src/OFHTTPServer.h
— part of check-in
[df7b88405a]
at
2012-12-27 11:21:43
on branch trunk
— OFHTTPServer: Pass errors from listening socket.
This way, it is possible to recover from errors by e.g. stopping the
server in the main thread and then restarting it, or by just ignoring
the exception. (user: js, size: 3958) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
32 33 34 35 36 37 38 39 40 41 42 43 44 45 | * * @param server The HTTP server which received the request * @param request The request the HTTP server received * @return The reply the HTTP server should send to the client */ - (OFHTTPRequestReply*)server: (OFHTTPServer*)server didReceiveRequest: (OFHTTPRequest*)request; @end /*! * @brief A class for creating a simple HTTP server inside of applications. */ @interface OFHTTPServer: OFObject { | > > > > > > > > > > > > > > > > | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | * * @param server The HTTP server which received the request * @param request The request the HTTP server received * @return The reply the HTTP server should send to the client */ - (OFHTTPRequestReply*)server: (OFHTTPServer*)server didReceiveRequest: (OFHTTPRequest*)request; #ifdef OF_HAVE_OPTIONAL_PROTOCOLS @optional #endif /*! * @brief This method is called when the HTTP server's listening socket * encountered an exception. * * @param exception The exception that occurred on the HTTP server's listening * socket * @return Whether to continue listening. If you return NO, existing connections * will still be handled and you can start accepting new connections * again by calling @ref start again. */ - (BOOL)server: (OFHTTPServer*)server didReceiveExceptionOnListeningSocket: (OFException*)e; @end /*! * @brief A class for creating a simple HTTP server inside of applications. */ @interface OFHTTPServer: OFObject { |
︙ | ︙ | |||
132 133 134 135 136 137 138 | */ - (void)stop; - (BOOL)OF_socket: (OFTCPSocket*)socket didAcceptSocket: (OFTCPSocket*)clientSocket exception: (OFException*)exception; @end | > > > | 148 149 150 151 152 153 154 155 156 157 | */ - (void)stop; - (BOOL)OF_socket: (OFTCPSocket*)socket didAcceptSocket: (OFTCPSocket*)clientSocket exception: (OFException*)exception; @end @interface OFObject (OFHTTPServerDelegate) <OFHTTPServerDelegate> @end |