You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-20Lines changed: 43 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@ Look in the example folder for a comprehensive set of code examples covering the
21
21
22
22
## Note About Terminology
23
23
24
-
Please note that within this library **resource names**, as defined in
25
-
the WebSocket protocol specification, are referred to as **services**.
24
+
Please note that within this library **"resource names"**, as defined in
25
+
the WebSocket protocol specification, are referred to as **"services"**.
26
26
27
27
# Library
28
28
@@ -51,7 +51,7 @@ which the client should connect.
51
51
This actor's role is solely that of launching and managing the stop of
52
52
"WebSocket Server" actors listening on at a specific port and interface
53
53
address ("Launch Server Msg" and "Stop Server Msg" messages). The actor
54
-
will ensure that the launched "WebSocket Server" doesn’t conflict on
54
+
will ensure that the launched "WebSocket Server" actor doesn’t conflict on
55
55
interface and port resources. If the server is already running at that
56
56
port or on the specified interface the method sends just the server
57
57
enqueuer to the client. If the server is not running it will be
@@ -80,7 +80,7 @@ protocol will take care of communicating the failure to the client.
80
80
81
81
## WebSocket Service.lvclass
82
82
83
-
It forwards packets received from the connected WebSocket Clients to its
83
+
It forwards packets received from the connected "WebSocket Client" actors to its
84
84
subscriber actor as "WebSocket Connection Handler Msg" messages. It
85
85
allows the subscriber to send data to a specified client ("Send to Peer
86
86
Msg" message of the parent "WebSocket Connection" class) or to all
@@ -95,11 +95,11 @@ WebSocket service actor enqueuer.
95
95
96
96
## Abstract messages
97
97
98
-
Two abstract messages must be subclassed to allow the interaction of either a WebSocket Server, a WebSocket Service or a WebSocket Client with the corresponding subscriber actor.
98
+
Two abstract messages must be subclassed to allow the interaction of either a "WebSocket Server", a "WebSocket Service" or a "WebSocket Client" actor with the corresponding subscriber actor.
99
99
100
100
### WebSocket Connection Handler Msg.lvclass
101
101
102
-
This abstract message is sent by either the WebSocket Client or by the
102
+
This abstract message is sent by either the "WebSocket Client" or by the
103
103
WebSocket Service to the subscriber Actor on four events:
104
104
105
105
- Connect
@@ -119,12 +119,35 @@ corresponding event.
119
119
120
120
### WebSocket Server-Service Enqueuer Msg.lvclass
121
121
122
-
This abstract message is used either by the WebSocket Server Manager or
123
-
by the WebSocket Server to send the just launched/added Server/Service
122
+
This abstract message is used either by the **WebSocket Server Manager** actor or
123
+
by the **WebSocket Server** actor to send the just launched/added Server/Service
124
124
Enqueuer to the subscriber actor requesting the operation. Each
125
125
subscriber actor requesting the operation should subclass this message
126
-
and then override the Do.vi in which the Server/Service Enqueuer is
127
-
stored in the requesting actor.
126
+
and then override the Do.vi wherein the Server/Service Enqueuer can be read from the suitable abstract message property and stored in the subscriber actor.
127
+
128
+
## Errors
129
+
All custom error generated by this library are forwarded to the appropriate subscriber actor to be handled by the "Handle Error" method. If such method is not overridden by the subscriber actor, the actor will stop when the subscribed actor generates an errors. All the errors generated the connection level will result
130
+
131
+
The custom errors defined by this library are the following:
132
+
133
+
### 512000: The WebSocket connection dropped for unknown reasons.**
134
+
135
+
This error is generated when the connection is dropped for an unknown reason most likely related to problems with the TCP/IP connection. In such cases a "Drop" type "WebSocket Connection Handler Msg" concrete message will be fired, allowing the subscriber (either a to a "WebSocket Client" actor or a "WebSocket Server" actor) to react to this situation by overriding the Drop method within the message concrete implementation. Please note that if the Keepalive system is activated and a peer doesn't reply within the specified timeout, no error is generated. Rather, only the "Drop" type message is fired.
136
+
137
+
### 512001: The WebSocket Server could not establish a connection to the peer for unknown reasons.
138
+
139
+
This error is generated by the "WebSocket Server" actor when he is not able to establish a connection to the WebSocket client. In such cases the is presumed that the "WebSocket Server" actor is still able to establish new connections if requested.
140
+
141
+
### 512002: The WebSocket Server listener could not be created. Server is going to stop.
142
+
This is generated upon a "WebSocket Server" actor launch in case a TCP/IP listener cannot be created. In such case the Actor will stop.
143
+
144
+
### 512003: The WebSocket Server listener became invalid for unknown reasons. The WebSocket Server is not accepting the definition of any new server.
145
+
146
+
This is generated within the lifetime of a "WebSocket Server" actor when the TCP/IP listener becomes invalid. In such case the Actor will not stop, but will not be accepting the addition of any new service from the subscriber.
147
+
148
+
### 512004: The WebSocket Server is not accepting the definition of any new service.
149
+
In case one tries to add a service to a "WebSocket Server" actor that stopped to accept the addition of new services (see Error 512004) the subscriber demanding an addition will receive this error.
150
+
128
151
129
152
# API
130
153
@@ -144,7 +167,7 @@ Before launch the "Server Manager Actor" can be configured with the Keepalive se
144
167
145
168

146
169
147
-
**Keepalive** The Keepalive settings will be active for all the WebSocket Servers launched by the "WebSocket Server Manager Actor"
170
+
**Keepalive** The Keepalive settings will be active for all the WebSocket Servers launched by the "WebSocket Server Manager" actor
148
171
149
172
**Certificate Chain** specifies an array of Distinguished Encoding Rules (DER) certificates. The certificates must be supplied depth-first: the server's certificate, followed by the Certificate Authority (CA) that signs the certificate of the server, on up to the root CA. For more details see LabVIEW TLS examples.
150
173
@@ -198,13 +221,13 @@ Enqueuer Msg.lvclass*”.
198
221
alt="A computer screen shot of a message Description automatically generated" />
199
222
200
223
**Subscriber Enqueuer** specifies the enqueuer of the actor that has
201
-
subscribed to the previously launched WebSocket Server actor.
224
+
subscribed to the previously launched "WebSocket Server" actor.
202
225
203
-
**Message Enqueuer in** specifies the enqueuer of the WebSocket Server
204
-
Manager actor to be stopped.
226
+
**Message Enqueuer in** specifies the enqueuer of the "WebSocket Server
227
+
Manager" actor to be stopped.
205
228
206
229
**Listener Settings** specifies the listener settings for the previously
207
-
launched WebSocket Server actor.
230
+
launched "WebSocket Server" actor.
208
231
209
232
**Handshake timeout** specifies the timeout of the handshake when the
210
233
client establishes a WebSocket connection to the server.
@@ -215,7 +238,7 @@ Enqueuer Msg.lvclass*”.
215
238
216
239
## WebSocket Server
217
240
218
-
In case the WebSocket Server Actor is manually launched the following
241
+
In case the "WebSocket Server" actor is manually launched the following
219
242
properties are available to configure it (the port must be entered)
220
243
before its launch
221
244
@@ -248,12 +271,12 @@ alt="A computer screen shot of a message Description automatically generated" />
248
271
created) child of the abstract message “*WebSocket Server-Service
249
272
Enqueuer Msg.lvclass”.*
250
273
251
-
**Message Enqueuer in** specifies the enqueuer of the WebSocket Server
274
+
**Message Enqueuer in** specifies the enqueuer of the "WebSocket Server"
252
275
actor.
253
276
254
277
**Service Name** specifies the name of the service.
255
278
256
-
**Subscriber Enqueuer** specifies the enqueuer of the actor that subscribes to the WebSocket Server Actor.
279
+
**Subscriber Enqueuer** specifies the enqueuer of the actor that subscribes to the "WebSocket Server" actor.
257
280
258
281
**WebSocket Data Handler** specifies the concrete message (to be
259
282
created) child of the abstract message “*WebSocket Connection Handler
@@ -285,7 +308,7 @@ we want to send the data
285
308
286
309
## WebSocket Client
287
310
288
-
The following properties of the WebSocket Client actor must be set
311
+
The following properties of the "WebSocket Client" actor must be set
289
312
before launching it:
290
313
291
314

@@ -307,7 +330,7 @@ created) child of the abstract message “*WebSocket Connection Handler
307
330
Msg.lvclass”.*
308
331
309
332
**Subscriber Enqueuer** specifies the enqueuer of the actor (must be
310
-
created) that subscribes to the WebSocket Client Actor.
333
+
created) that subscribes to the "WebSocket Client" actor.
311
334
312
335
**Keepalive** specifies the Keepalive settings for the Client (see
0 commit comments