Extracted network socket classes from httpd folder, and created a new library/network/http_network library.

Renamed HTTPD_STREAM_SOCKET as HTTP_STREAM_SOCKET.
Made http_client (net) library use the new http_network library.
This commit is contained in:
2016-10-12 23:27:55 +02:00
parent c132d7734b
commit 981942b2d6
30 changed files with 160 additions and 102 deletions

View File

@@ -33,9 +33,9 @@ feature -- Access
feature {HTTPD_SERVER_I} -- Execution
accept_incoming_connection (a_listening_socket: HTTPD_STREAM_SOCKET)
accept_incoming_connection (a_listening_socket: HTTP_STREAM_SOCKET)
local
cl: HTTPD_STREAM_SOCKET
cl: HTTP_STREAM_SOCKET
do
is_shutdown_requested := is_shutdown_requested or shutdown_requested (server)
if is_shutdown_requested then

View File

@@ -64,19 +64,19 @@ feature {HTTPD_SERVER_I} -- Execution
p.gracefull_stop
end
accept_incoming_connection (a_listening_socket: HTTPD_STREAM_SOCKET)
accept_incoming_connection (a_listening_socket: HTTP_STREAM_SOCKET)
-- <Precursor>
do
accept_connection_on_pool (pool, a_listening_socket) -- Wait on not pool.is_full or is_stop_requested
end
accept_connection_on_pool (a_pool: like pool; a_listening_socket: HTTPD_STREAM_SOCKET)
accept_connection_on_pool (a_pool: like pool; a_listening_socket: HTTP_STREAM_SOCKET)
-- Process accept connection
-- note that the precondition matters for scoop synchronization.
require
concurrency: not a_pool.is_full or is_shutdown_requested or a_pool.stop_requested
local
cl: separate HTTPD_STREAM_SOCKET
cl: separate HTTP_STREAM_SOCKET
do
debug ("dbglog")
dbglog (generator + ".ENTER accept_connection_on_pool")
@@ -121,7 +121,7 @@ feature {HTTPD_SERVER_I} -- Status report
feature {NONE} -- Implementation
separate_client_socket (hdl: separate HTTPD_REQUEST_HANDLER): separate HTTPD_STREAM_SOCKET
separate_client_socket (hdl: separate HTTPD_REQUEST_HANDLER): separate HTTP_STREAM_SOCKET
-- Client socket for request handler `hdl'.
do
Result := hdl.client_socket

View File

@@ -51,9 +51,9 @@ feature {HTTPD_SERVER_I} -- Execution
p.terminate
end
accept_incoming_connection (a_listening_socket: HTTPD_STREAM_SOCKET)
accept_incoming_connection (a_listening_socket: HTTP_STREAM_SOCKET)
local
cl: separate HTTPD_STREAM_SOCKET
cl: separate HTTP_STREAM_SOCKET
do
debug ("dbglog")
dbglog (generator + ".ENTER accept_connection {"+ a_listening_socket.descriptor.out +"}")