FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
expresscpp/include/expresscpp/impl/session.hpp at master · Neko-Life/expresscpp · GitHub
Neko-Life
/
expresscpp
Public
forked from
expresscpp/expresscpp
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
expresscpp
/
include
/
expresscpp
/
impl
/
session.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
60 lines (44 loc) · 1.32 KB
Breadcrumbs
expresscpp
/
include
/
expresscpp
/
impl
/
session.hpp
Copy path
File metadata and controls
60 lines (44 loc) · 1.32 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
#
pragma
once
#
include
<
algorithm
>
#
include
<
cstdlib
>
#
include
<
functional
>
#
include
<
iostream
>
#
include
<
memory
>
#
include
<
string
>
#
include
<
thread
>
#
include
<
vector
>
#
include
"
boost/asio.hpp
"
#
include
"
boost/beast/core.hpp
"
#
include
"
boost/beast/http.hpp
"
#
include
"
boost/beast/version.hpp
"
#
include
"
boost/config.hpp
"
#
include
"
boost/filesystem.hpp
"
#
include
"
expresscpp/impl/utils.hpp
"
namespace
expresscpp
{
class
ExpressCpp
;
class
Response
;
class
Listener
;
using
SessionParser = boost::beast::http::request_parser<boost::beast::http::string_body>;
//
Handles an HTTP server connection
class
Session
:
public
std
::enable_shared_from_this<Session> {
friend
Response;
public:
//
Take ownership of the stream
Session
(boost::asio::ip::tcp::socket socket, ExpressCpp* express_cpp);
~Session
();
boost::asio::ip::tcp::socket socket_;
boost::beast::flat_buffer buffer_{
8192
};
std::shared_ptr<
void
> res_;
ExpressCpp* express_cpp_;
//
Start the asynchronous operation
void
run
();
private:
void
do_read
();
void
on_read
(boost::beast::error_code ec, std::
size_t
bytes_transferred);
void
do_close
();
//
The parser for reading the requests
std::unique_ptr<SessionParser> parser_;
protected:
void
on_write
(
bool
close, boost::beast::error_code ec, std::
size_t
bytes_transferred);
};
}
//
namespace expresscpp
Back
|
FazBrowse Home
|
New Git URL