Compare commits
3 Commits
net_sendfi
...
es_rev9962
| Author | SHA1 | Date | |
|---|---|---|---|
| f56aa22c29 | |||
| 186e5514eb | |||
| 9fd53b9b1f |
@@ -11,10 +11,6 @@
|
||||
</option>
|
||||
<setting name="console_application" value="true"/>
|
||||
<setting name="concurrency" value="scoop"/>
|
||||
<capability>
|
||||
<concurrency support="scoop" use="scoop"/>
|
||||
<void_safety support="all"/>
|
||||
</capability>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="encoder" location="..\..\library\text\encoder\encoder-safe.ecf" readonly="false"/>
|
||||
<library name="http" location="..\..\library\network\protocol\http\http-safe.ecf"/>
|
||||
@@ -24,9 +20,6 @@
|
||||
<target name="debug_any" extends="common">
|
||||
<root class="EWF_DEBUG_SERVER" feature="make_and_launch"/>
|
||||
<setting name="concurrency" value="scoop"/>
|
||||
<capability>
|
||||
<concurrency support="scoop" use="scoop"/>
|
||||
</capability>
|
||||
<library name="cgi" location="..\..\library\server\wsf\connector\cgi-safe.ecf" readonly="false"/>
|
||||
<library name="libfcgi" location="..\..\library\server\wsf\connector\libfcgi-safe.ecf" readonly="false"/>
|
||||
<library name="standalone" location="..\..\library\server\wsf\connector\standalone-safe.ecf" readonly="false"/>
|
||||
@@ -36,9 +29,6 @@
|
||||
<target name="debug_standalone" extends="common">
|
||||
<root class="EWF_DEBUG_SERVER" feature="make_and_launch"/>
|
||||
<setting name="concurrency" value="scoop"/>
|
||||
<capability>
|
||||
<concurrency support="scoop" use="scoop"/>
|
||||
</capability>
|
||||
<library name="default_standalone" location="..\..\library\server\wsf\default\standalone-safe.ecf" readonly="false"/>
|
||||
<cluster name="launcher" location=".\launcher\default\" recursive="true"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<setting name="console_application" value="true"/>
|
||||
<setting name="concurrency" value="scoop"/>
|
||||
<variable name="ssl_supported" value="false"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="http" location="..\..\library\network\protocol\http\http-safe.ecf"/>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<setting name="console_application" value="true"/>
|
||||
<setting name="concurrency" value="scoop"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="http" location="..\..\library\network\protocol\http\http-safe.ecf"/>
|
||||
<library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf"/>
|
||||
|
||||
@@ -22,13 +22,10 @@ create
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
initialize
|
||||
local
|
||||
opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS
|
||||
do
|
||||
Precursor
|
||||
--| Uncomment the following 2 lines, to read options from "ewf.ini" configuration file
|
||||
-- create {WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI} opts.make_from_file ("ewf.ini")
|
||||
-- import_service_options (opts)
|
||||
--| Uncomment the following line, to read options from "ewf.ini" configuration file
|
||||
-- import_service_options (create {WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI} opts.make_from_file ("ewf.ini"))
|
||||
end
|
||||
|
||||
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
|
||||
@@ -29,10 +29,8 @@ feature {NONE} -- Initialization
|
||||
|
||||
create ws_client.make_with_port ("ws://echo.websocket.org", 80, Void)
|
||||
-- create ws_client.make_with_port ("ws://127.0.0.1", 9090, Void)
|
||||
ws_client.launch
|
||||
ws_client.join_all
|
||||
|
||||
execution_environment.sleep (5_000_000)
|
||||
ws_client.execute
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<option warning="true" void_safety="all">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<setting name="concurrency" value="scoop"/>
|
||||
<setting name="console_application" value="true"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="web_socket_client" location="..\..\web_socket_client-safe.ecf" readonly="false"/>
|
||||
@@ -17,7 +18,7 @@
|
||||
</target>
|
||||
<target name="ws_client" extends="common">
|
||||
<root class="APPLICATION" feature="make"/>
|
||||
<setting name="concurrency" value="thread"/>
|
||||
<setting name="concurrency" value="scoop"/>
|
||||
</target>
|
||||
<target name="ws_client_ssl" extends="ws_client">
|
||||
<variable name="ssl_enabled" value="true"/>
|
||||
|
||||
@@ -23,11 +23,6 @@ inherit
|
||||
|
||||
WEB_SOCKET
|
||||
|
||||
THREAD
|
||||
rename
|
||||
make as thread_make
|
||||
end
|
||||
|
||||
feature -- Initialization
|
||||
|
||||
initialize (a_uri: READABLE_STRING_GENERAL; a_protocols: detachable ITERABLE [STRING])
|
||||
@@ -35,7 +30,6 @@ feature -- Initialization
|
||||
require
|
||||
is_valid_uri: is_valid_uri (a_uri)
|
||||
do
|
||||
thread_make
|
||||
uri := a_uri
|
||||
set_default_port
|
||||
create protocol.make_empty
|
||||
@@ -50,7 +44,6 @@ feature -- Initialization
|
||||
require
|
||||
is_valid_uri: is_valid_uri (a_uri)
|
||||
do
|
||||
thread_make
|
||||
uri := a_uri
|
||||
port := a_port
|
||||
create protocol.make_empty
|
||||
@@ -64,11 +57,9 @@ feature -- Initialization
|
||||
require
|
||||
is_valid_uri: is_valid_uri (a_host)
|
||||
do
|
||||
thread_make
|
||||
uri := a_host + ":" + a_port.out + a_path
|
||||
port := a_port
|
||||
create protocol.make_empty
|
||||
-- set_protocols (a_protocols)
|
||||
create ready_state.make
|
||||
socket := new_socket (port, host)
|
||||
create server_handshake.make
|
||||
@@ -98,9 +89,11 @@ feature -- Access
|
||||
local
|
||||
l_uri: URI
|
||||
do
|
||||
create l_uri.make_from_string (a_uri.as_string_8)
|
||||
if a_uri.is_valid_as_string_8 then
|
||||
create l_uri.make_from_string (a_uri.to_string_8)
|
||||
Result := l_uri.is_valid
|
||||
end
|
||||
end
|
||||
|
||||
server_handshake: WEB_SOCKET_HANDSHAKE_DATA
|
||||
-- Handshake data received from the server
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
<library name="lib_http_network" location="..\..\http_network\http_network-safe.ecf"/>
|
||||
<library name="lib_web_socket_protocol" location="..\protocol\web_socket_protocol-safe.ecf"/>
|
||||
<library name="net" location="$ISE_LIBRARY\library\net\net-safe.ecf"/>
|
||||
<library name="thread" location="$ISE_LIBRARY\library\thread\thread-safe.ecf"/>
|
||||
<library name="uri" location="$ISE_LIBRARY\library\text\uri\uri-safe.ecf"/>
|
||||
<cluster name="web_socket_client" location=".\src\" recursive="true">
|
||||
<file_rule>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
<library name="lib_http_network" location="..\..\http_network\http_network.ecf"/>
|
||||
<library name="lib_web_socket_protocol" location="..\protocol\web_socket_protocol.ecf"/>
|
||||
<library name="net" location="$ISE_LIBRARY\library\net\net.ecf"/>
|
||||
<library name="thread" location="$ISE_LIBRARY\library\thread\thread.ecf"/>
|
||||
<library name="uri" location="$ISE_LIBRARY\library\text\uri\uri.ecf"/>
|
||||
<cluster name="web_socket_client" location=".\src\" recursive="true">
|
||||
<file_rule>
|
||||
|
||||
@@ -106,8 +106,10 @@ feature -- Output operation
|
||||
put_file_content (f: FILE; a_offset: INTEGER; a_count: INTEGER)
|
||||
-- Send `a_count' bytes from the content of file `f' starting at offset `a_offset'.
|
||||
do
|
||||
if a_count > 0 then
|
||||
output.put_file_content (f, a_offset, a_count)
|
||||
end
|
||||
end
|
||||
|
||||
flush
|
||||
do
|
||||
|
||||
@@ -170,6 +170,9 @@ feature -- Status change
|
||||
-- Report error occurred, with optional message `m'.
|
||||
do
|
||||
has_error := True
|
||||
if m /= Void and then is_verbose then
|
||||
log (m.as_string_8, debug_level)
|
||||
end
|
||||
end
|
||||
|
||||
reset_error
|
||||
@@ -313,7 +316,7 @@ feature -- Execution
|
||||
is_persistent_connection_requested := False
|
||||
else
|
||||
if is_verbose then
|
||||
log (request_header, information_level)
|
||||
log_with_separation_line (request_header, information_level)
|
||||
end
|
||||
process_request (l_socket)
|
||||
end
|
||||
@@ -590,6 +593,26 @@ feature -- Output
|
||||
logger_set: logger = a_logger
|
||||
end
|
||||
|
||||
log_with_separation_line (m: STRING; a_level: INTEGER)
|
||||
-- Log message `m'.
|
||||
require
|
||||
is_verbose: is_verbose
|
||||
local
|
||||
s: STRING
|
||||
do
|
||||
if is_verbose and (verbose_level & a_level) = a_level then
|
||||
create s.make (m.count + 42)
|
||||
s.append (create {STRING}.make_filled ('-', 40))
|
||||
s.append_character ('%N')
|
||||
s.append (m)
|
||||
if attached logger as l_logger then
|
||||
l_logger.log (s)
|
||||
else
|
||||
io.put_string (s + "%N")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
log (m: STRING; a_level: INTEGER)
|
||||
-- Log message `m'.
|
||||
require
|
||||
|
||||
@@ -389,9 +389,11 @@ feature -- Body
|
||||
message_writable: message_writable
|
||||
not_too_big: a_offset + a_count <= f.count
|
||||
do
|
||||
if a_count > 0 then
|
||||
wgi_response.put_file_content (f, a_offset, a_count)
|
||||
increment_transfered_content_length (a_count)
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Chunk body
|
||||
|
||||
|
||||
Reference in New Issue
Block a user