Zen API
 All Classes Files Functions Variables Typedefs Macros Groups Pages
kHttpServerChannel.h
Go to the documentation of this file.
1 /**
2  * @file kHttpServerChannel.h
3  * @brief Declares the kHttpServerChannel class.
4  *
5  * @internal
6  * Copyright (C) 2013-2014 by LMI Technologies Inc.
7  * Licensed under the MIT License.
8  * Redistributed files must retain the above copyright notice.
9  */
10 #ifndef K_API_HTTP_SERVER_CHANNEL_H
11 #define K_API_HTTP_SERVER_CHANNEL_H
12 
13 #include <kApi/Io/kNetwork.h>
14 
15 kBeginHeader()
16 
17 /**
18  * @class kHttpServerChannel
19  * @extends kObject
20  * @ingroup kApi-Io
21  * @brief Represents the server side of an HTTP connection.
22  */
23 //typedef kObject kHttpServerChannel; --forward-declared in kApiDef.x.h
24 
25 kEndHeader()
26 
27 /**
28  * Accesses a kHttpServerRequest object that can be used to parse an incoming request.
29  *
30  * @public @memberof kHttpServerChannel
31  * @param channel Channel object.
32  * @return Request object.
33  */
35 
36 /**
37  * Accesses a kHttpServerResponse object that can be used to format an outgoing response.
38  *
39  * @public @memberof kHttpServerChannel
40  * @param channel Channel object.
41  * @return Response object.
42  */
44 
45 /**
46  * Transfers ownership of the underlying TCP client object associated with this channel.
47  *
48  * Use this function to assume control of the channel's TCP client object. This function should only be called
49  * after formatting an HTTP response, just prior to returning from a request processing callback.
50  *
51  * The primary purpose of this function is to support the WebSocket protocol. If a WebSocket request is
52  * received, the server can format a 101-switching-protocols response, then call this function to take
53  * control of the client for subsequent communication.
54  *
55  * Use kObject_Destroy to free the TCP client object when it is no longer needed.
56  *
57  * @public @memberof kHttpServerChannel
58  * @param channel Channel object.
59  * @param client Receives TCP client object.
60  * @return Response object.
61  */
63 
64 #include <kApi/Io/kHttpServerChannel.x.h>
65 
66 #endif
kStatus kHttpServerChannel_DetachClient(kHttpServerChannel channel, kTcpClient *client)
Transfers ownership of the underlying TCP client object associated with this channel.
kHttpServerResponse kHttpServerChannel_Response(kHttpServerChannel channel)
Accesses a kHttpServerResponse object that can be used to format an outgoing response.
Represents the server side of an HTTP connection.
Represents a TCP client.
kHttpServerRequest kHttpServerChannel_Request(kHttpServerChannel channel)
Accesses a kHttpServerRequest object that can be used to parse an incoming request.
Supports HTTP server response formatting.
IP networking definitions.
Represents an enumeration of error codes.
Supports HTTP server request parsing.