@@ -64,7 +64,7 @@ class BCT_API socket
6464 // / Block on threadpool.join() to ensure termination of the connection.
6565 virtual void stop () NOEXCEPT;
6666
67- // / TCP .
67+ // / Accept/Connect .
6868 // / -----------------------------------------------------------------------
6969
7070 // / Accept an incoming connection, handler posted to *acceptor* strand.
@@ -76,6 +76,9 @@ class BCT_API socket
7676 virtual void connect (const asio::endpoints& range,
7777 result_handler&& handler) NOEXCEPT;
7878
79+ // / TCP.
80+ // / -----------------------------------------------------------------------
81+
7982 // / Read full buffer from the socket, handler posted to socket strand.
8083 virtual void read (const asio::mutable_buffer& out,
8184 count_handler&& handler) NOEXCEPT;
@@ -84,44 +87,17 @@ class BCT_API socket
8487 virtual void write (const asio::const_buffer& in,
8588 count_handler&& handler) NOEXCEPT;
8689
87- // / HTTP Readers .
90+ // / HTTP.
8891 // / -----------------------------------------------------------------------
8992
9093 // / Read full http variant request from the socket.
9194 virtual void http_read (http::flat_buffer& buffer,
9295 http::request& request, count_handler&& handler) NOEXCEPT;
9396
94- // / Read full http string request from the socket.
95- virtual void http_read (http::flat_buffer& buffer,
96- http::string_request& request, count_handler&& handler) NOEXCEPT;
97-
98- // / Read full http json request from the socket.
99- virtual void http_read (http::flat_buffer& buffer,
100- http::json_request& request, count_handler&& handler) NOEXCEPT;
101-
102- // / HTTP Writers.
103- // / -----------------------------------------------------------------------
104-
10597 // / Write full http variant response to the socket.
10698 virtual void http_write (http::response& response,
10799 count_handler&& handler) NOEXCEPT;
108100
109- // / Write full http string response to the socket.
110- virtual void http_write (http::string_response& response,
111- count_handler&& handler) NOEXCEPT;
112-
113- // / Write full http json response to the socket.
114- virtual void http_write (http::json_response& response,
115- count_handler&& handler) NOEXCEPT;
116-
117- // / Write full http data response to the socket.
118- virtual void http_write (http::data_response& response,
119- count_handler&& handler) NOEXCEPT;
120-
121- // / Write full http file response to the socket.
122- virtual void http_write (http::file_response& response,
123- count_handler&& handler) NOEXCEPT;
124-
125101 // / Properties.
126102 // / -----------------------------------------------------------------------
127103
@@ -153,44 +129,24 @@ class BCT_API socket
153129private:
154130 void do_stop () NOEXCEPT;
155131
156- // tcp
132+ // accept/connect
157133 void do_connect (const asio::endpoints& range,
158134 const result_handler& handler) NOEXCEPT;
135+
136+ // tcp
159137 void do_read (const asio::mutable_buffer& out,
160138 const count_handler& handler) NOEXCEPT;
161139 void do_write (const asio::const_buffer& in,
162140 const count_handler& handler) NOEXCEPT;
163141
164- // http readers
142+ // http
165143 void do_http_read (
166144 const std::reference_wrapper<http::flat_buffer>& buffer,
167145 const std::reference_wrapper<http::request>& request,
168146 const count_handler& handler) NOEXCEPT;
169- void do_http_read_string (
170- const std::reference_wrapper<http::flat_buffer>& buffer,
171- const std::reference_wrapper<http::string_request>& request,
172- const count_handler& handler) NOEXCEPT;
173- void do_http_read_json (
174- const std::reference_wrapper<http::flat_buffer>& buffer,
175- const std::reference_wrapper<http::json_request>& request,
176- const count_handler& handler) NOEXCEPT;
177-
178- // http writers
179147 void do_http_write (
180148 const std::reference_wrapper<http::response>& response,
181149 const count_handler& handler) NOEXCEPT;
182- void do_http_write_string (
183- const std::reference_wrapper<http::string_response>& response,
184- const count_handler& handler) NOEXCEPT;;
185- void do_http_write_json (
186- const std::reference_wrapper<http::json_response>& response,
187- const count_handler& handler) NOEXCEPT;
188- void do_http_write_data (
189- const std::reference_wrapper<http::data_response>& response,
190- const count_handler& handler) NOEXCEPT;
191- void do_http_write_file (
192- const std::reference_wrapper<http::file_response>& response,
193- const count_handler& handler) NOEXCEPT;
194150
195151 // completion
196152 void handle_accept (const boost_code& ec,
0 commit comments