22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
OF_ASSUME_NONNULL_BEGIN
@class OFHTTPServer;
@class OFHTTPRequest;
@class OFHTTPResponse;
@class OFTCPSocket;
@class OFException;
/*!
* @protocol OFHTTPServerDelegate OFHTTPServer.h ObjFW/OFHTTPServer.h
*
* @brief A delegate for OFHTTPServer.
*/
@protocol OFHTTPServerDelegate <OFObject>
|
<
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
OF_ASSUME_NONNULL_BEGIN
@class OFHTTPServer;
@class OFHTTPRequest;
@class OFHTTPResponse;
@class OFTCPSocket;
/*!
* @protocol OFHTTPServerDelegate OFHTTPServer.h ObjFW/OFHTTPServer.h
*
* @brief A delegate for OFHTTPServer.
*/
@protocol OFHTTPServerDelegate <OFObject>
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
* @param exception The exception which occurred on the HTTP server's listening
* socket
* @return Whether to continue listening. If you return false, existing
* connections will still be handled and you can start accepting new
* connections again by calling @ref OFHTTPServer::start again.
*/
- (bool)server: (OFHTTPServer *)server
didReceiveExceptionOnListeningSocket: (OFException *)exception;
/*!
* @brief This method is called when a client socket encountered an exception.
*
* This can happen when the OFHTTPServer tries to properly close the
* connection. If no headers have been sent yet, it will send headers, and if
* chunked transfer encoding was used, it will send a chunk of size 0. However,
* if the other end already closed the connection before that, this will raise
* an exception.
*
* @param server The HTTP server which encountered an exception
* @param response The response for which the exception occurred
* @param request The request for the response for which the exception occurred
* @param exception The exception which occurred
*/
- (void)server: (OFHTTPServer *)server
didReceiveExceptionForResponse: (OFHTTPResponse *)response
request: (OFHTTPRequest *)request
exception: (OFException *)exception;
@end
/*!
* @class OFHTTPServer OFHTTPServer.h ObjFW/OFHTTPServer.h
*
* @brief A class for creating a simple HTTP server inside of applications.
*/
|
|
|
|
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
* @param exception The exception which occurred on the HTTP server's listening
* socket
* @return Whether to continue listening. If you return false, existing
* connections will still be handled and you can start accepting new
* connections again by calling @ref OFHTTPServer::start again.
*/
- (bool)server: (OFHTTPServer *)server
didReceiveExceptionOnListeningSocket: (id)exception;
/*!
* @brief This method is called when a client socket encountered an exception.
*
* This can happen when the OFHTTPServer tries to properly close the
* connection. If no headers have been sent yet, it will send headers, and if
* chunked transfer encoding was used, it will send a chunk of size 0. However,
* if the other end already closed the connection before that, this will raise
* an exception.
*
* @param server The HTTP server which encountered an exception
* @param response The response for which the exception occurred
* @param request The request for the response for which the exception occurred
* @param exception The exception which occurred
*/
- (void)server: (OFHTTPServer *)server
didReceiveExceptionForResponse: (OFHTTPResponse *)response
request: (OFHTTPRequest *)request
exception: (id)exception;
@end
/*!
* @class OFHTTPServer OFHTTPServer.h ObjFW/OFHTTPServer.h
*
* @brief A class for creating a simple HTTP server inside of applications.
*/
|