Reuse http_network library.
Reintroduced HTTPD_STREAM_SOCKET for backward compatibility, and ease of usage. Added websocket libraries (client, and protocol).
This commit is contained in:
61
library/network/websocket/client/src/web_socket_subscriber.e
Normal file
61
library/network/websocket/client/src/web_socket_subscriber.e
Normal file
@@ -0,0 +1,61 @@
|
||||
note
|
||||
description: "Summary description for {WEB_SOCKET_SUBSCRIBER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WEB_SOCKET_SUBSCRIBER
|
||||
|
||||
|
||||
feature -- Events
|
||||
|
||||
on_websocket_ping (a_message: detachable STRING)
|
||||
-- Send a ping in response to a received ping.
|
||||
do
|
||||
end
|
||||
|
||||
|
||||
on_websocket_pong (a_message: detachable STRING)
|
||||
-- Default implementation do nothing.
|
||||
do
|
||||
end
|
||||
|
||||
|
||||
on_websocket_text_message (a_message: detachable STRING)
|
||||
-- Default implementation do nothing.
|
||||
do
|
||||
end
|
||||
|
||||
on_websocket_binary_message (a_message: detachable STRING)
|
||||
-- Default implementation do nothing.
|
||||
do
|
||||
end
|
||||
|
||||
|
||||
on_websocket_open (a_message: detachable STRING)
|
||||
do
|
||||
end
|
||||
|
||||
|
||||
on_websocket_close (a_message: detachable STRING)
|
||||
do
|
||||
end
|
||||
|
||||
on_websocket_error (a_error: detachable STRING)
|
||||
do
|
||||
end
|
||||
|
||||
feature -- Handshake
|
||||
|
||||
on_websocket_handshake (request: STRING)
|
||||
-- Default do nothing
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- TCP connection
|
||||
|
||||
connection: HTTP_STREAM_SOCKET
|
||||
deferred
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user