@@ -45,6 +45,10 @@ package AWS.Net.WebSocket is
45
45
46
46
type Object is new Net.Socket_Type with private ;
47
47
type Object_Class is access all Object'Class;
48
+ -- To implement your own handling of messages, you need to extend this
49
+ -- type and override at least the On_Message primitive operation.
50
+ -- In addition, you need to register a factory (to create new objects based
51
+ -- on the URI) using AWS.Net.WebSocket.Registry.Register).
48
52
49
53
No_Object : constant Object'Class;
50
54
@@ -88,7 +92,7 @@ package AWS.Net.WebSocket is
88
92
-- This function must be registered via AWS.Net.WebSocket.Registry.Register
89
93
90
94
procedure On_Message (Socket : in out Object; Message : String) is null ;
91
- -- Default implementation does nothing, it needs to be overriden by the
95
+ -- Default implementation does nothing, it needs to be overridden by the
92
96
-- end-user. This is the callback that will get activated for every server
93
97
-- incoming data. It is also important to keep in mind that the thread
94
98
-- handling this WebSocket won't be released until the procedure returns.
@@ -97,11 +101,11 @@ package AWS.Net.WebSocket is
97
101
98
102
procedure On_Message (Socket : in out Object; Message : Unbounded_String);
99
103
-- Same a above but takes an Unbounded_String. This is supposed to be
100
- -- overriden when handling large messages otherwise a stack-overflow could
101
- -- be raised. The default implementation of this procedure to to call the
104
+ -- overridden when handling large messages otherwise a stack-overflow could
105
+ -- be raised. The default implementation of this procedure to call the
102
106
-- On_Message above with a string.
103
107
--
104
- -- So either this version is overriden to handle the incoming messages or
108
+ -- So either this version is overridden to handle the incoming messages or
105
109
-- the one above if the messages are known to be small.
106
110
107
111
procedure On_Open (Socket : in out Object; Message : String) is null ;
@@ -119,7 +123,7 @@ package AWS.Net.WebSocket is
119
123
(Socket : in out Object;
120
124
Message : String;
121
125
Is_Binary : Boolean := False);
122
- -- This default implementation just send a message to the client. The
126
+ -- This default implementation just sends a message to the client. The
123
127
-- message is sent in a single chunk (not fragmented).
124
128
125
129
procedure Send
@@ -167,7 +171,7 @@ package AWS.Net.WebSocket is
167
171
--
168
172
-- These function waits until it either receives a close or an error, or
169
173
-- the beginning of a message frame. In the latter case, the function
170
- -- will then block until it has receives all chunks of that frame, which
174
+ -- will then block until it has received all chunks of that frame, which
171
175
-- might take longer than Timeout.
172
176
--
173
177
-- The function will return early if it doesn't receive the beginning
0 commit comments