Added websocket examples for the server and client.
This commit is contained in:
21
library/network/websocket/server/src/web_socket_execution.e
Normal file
21
library/network/websocket/server/src/web_socket_execution.e
Normal file
@@ -0,0 +1,21 @@
|
||||
note
|
||||
description: "Summary description for {WEB_SOCKET_EXECUTION}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WEB_SOCKET_EXECUTION
|
||||
|
||||
inherit
|
||||
WSF_WEBSOCKET_EXECUTION
|
||||
|
||||
WEB_SOCKET_EVENT_I
|
||||
|
||||
feature -- Websocket execution
|
||||
|
||||
new_websocket_handler (ws: WEB_SOCKET): WEB_SOCKET_HANDLER
|
||||
do
|
||||
create Result.make (ws, Current)
|
||||
end
|
||||
|
||||
end
|
||||
30
library/network/websocket/server/src/web_socket_service.e
Normal file
30
library/network/websocket/server/src/web_socket_service.e
Normal file
@@ -0,0 +1,30 @@
|
||||
note
|
||||
description: "Summary description for {WEB_SOCKET_SERVICE}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WEB_SOCKET_SERVICE [G -> WEB_SOCKET_EXECUTION create make end]
|
||||
|
||||
create
|
||||
make_and_launch
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_and_launch
|
||||
local
|
||||
l_launcher: WSF_STANDALONE_WEBSOCKET_SERVICE_LAUNCHER [G]
|
||||
opts: WEB_SOCKET_SERVICE_OPTIONS
|
||||
do
|
||||
create opts
|
||||
set_options (opts)
|
||||
opts.append_options (create {WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI}.make_from_file ("ws.ini"))
|
||||
create l_launcher.make_and_launch (opts)
|
||||
end
|
||||
|
||||
set_options (opts: WEB_SOCKET_SERVICE_OPTIONS)
|
||||
-- Set values on `opts'.
|
||||
do
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
note
|
||||
description: "Summary description for {WEB_SOCKET_SERVICE_OPTIONS}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WEB_SOCKET_SERVICE_OPTIONS
|
||||
|
||||
inherit
|
||||
WSF_STANDALONE_WEBSOCKET_SERVICE_OPTIONS
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user