Skip to content

Commit af97514

Browse files
committed
More work on Error Generation #8
* The errors generated by the WebSocket Server are now reported to the subscriber and not to the caller, hence they will not even pass through the Server Manager if used * Added custom errors generated by the Start Server, Stop Server, Add Service WebSocket Server methods * improved documentation
1 parent af5ef10 commit af97514

24 files changed

Lines changed: 107 additions & 67 deletions

Install Error Codes.vi

36 Bytes
Binary file not shown.

README.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,28 +84,39 @@ The subscriber actor can program the required action for the corresponding event
8484
This abstract message is used either by the **WebSocket Server Manager** actor or by the **WebSocket Server** actor to send the just launched/added Server/Service Enqueuer to the subscriber actor requesting the operation. Each subscriber actor requesting the operation should subclass this message 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.
8585

8686
## Errors
87-
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
8887

89-
The custom errors defined by this library are the following:
88+
### Errors Forwarded to Subscribers
89+
The following 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.
9090

91-
### 512000: The WebSocket connection dropped for unknown reasons.
91+
#### 512000: The WebSocket connection dropped for unknown reasons.
9292

93-
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 TO a "WebSocket Service" 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.
93+
This error is generated when the connection is dropped for an unknown reason most likely related to problems with the TCP/IP connection and forwarded to the "WebSocket Client" or "WebSocket Service" subscriber. 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 TO a "WebSocket Service" 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.
9494

95-
### 512001: The WebSocket Server could not establish a connection to the peer for unknown reasons.
95+
#### 512001: The WebSocket Server could not establish a connection to the peer for unknown reasons.
9696

97-
This error is generated by the "WebSocket Server" actor when it 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.
97+
This error is generated by the "WebSocket Server" actor when it is not able to establish a connection to the WebSocket client and forwarded to the launcher of the "WebSocket Server" actor. In such cases the is presumed that the "WebSocket Server" actor is still able to establish new connections if requested.
9898

99-
### 512002: The WebSocket Server listener could not be created. Server is going to stop.
100-
This is generated upon a "WebSocket Server" actor launch in case a TCP/IP listener cannot be created. In such case the "WebSocket Server" actor will stop.
99+
#### 512002: The WebSocket Server listener could not be created. Server is going to stop.
100+
This is generated upon a "WebSocket Server" actor launch in case a TCP/IP listener cannot be created and forwarded to the subscriber of the "WebSocket Server" actor. In such case the "WebSocket Server" actor will stop.
101101

102-
### 512003: The WebSocket Server listener became invalid for unknown reasons. The WebSocket Server is not accepting the definition of any new server.
102+
#### 512003: The WebSocket Server listener became invalid for unknown reasons. The WebSocket Server is not accepting the definition of any new server.
103103

104-
This is generated within the lifetime of a "WebSocket Server" actor when the TCP/IP listener becomes invalid. In such case the "WebSocket Server" actor will not stop, but will not be accepting the addition of any new services from the subscriber.
104+
This is generated within the lifetime of a "WebSocket Server" actor when the TCP/IP listener becomes invalid and forwarded to the subscriber of the "WebSocket Server" actor. In such case the "WebSocket Server" actor will not stop, but will not be accepting the addition of any new services from the subscriber.
105105

106-
### 512004: The WebSocket Server is not accepting the definition of any new service.
107-
In case one tries to add a service to a "WebSocket Server" actor that stopped accepting the addition of new services (see Error 512003) the subscriber demanding an addition will receive this error.
106+
#### 512004: The WebSocket Server is not accepting the definition of any new service.
107+
In case one tries to add a service to a "WebSocket Server" actor that stopped accepting the addition of new services (see Error 512003) this error is generated and forwarded to the subscriber of the "WebSocket Server" actor.
108108

109+
### Errors
110+
The following error, when triggered, are reported to the subscriber by means of the concrete implementation of the "WebSocket Server-Service Enqueuer Msg.lvclass" abstract message.
111+
112+
#### 512005" The WebSocket Server Manager cannot launch the specified WebSocket Server. Server already running.
113+
When launching a "WebSocket Server" actor, the "WebSocket Server Manager" found that a server with the specified listener settings is already running.
114+
115+
#### 512006" The WebSocket Server Manager cannot stop the specified WebSocket Server. Server not running.
116+
When stopping a "WebSocket Server" actor, the "WebSocket Server Manager" found that a server with the specified listener settings is not running.
117+
118+
#### 512007" The WebSocket Server cannot add the specified WebSocket Service. Service already running.
119+
When adding a "WebSocket Service" to a "WebSocket Server" the "WebSocket Server" actor found that a service with the specified service name already running.
109120

110121
# API
111122

@@ -157,9 +168,11 @@ alt="A screenshot of a computer Description automatically generated" />
157168

158169
**Message Enqueuer in** specifies the enqueuer of the WebSocket Server Manager actor.
159170

171+
**Subscriber Enqueuer** specifies the enqueuer of the actor that will receive the enquer an error if a server with such listener settings is not running. Such actor must have subclassed the abstract message WebSocket *Server-Service Enqueuer Msg.lvclass*
172+
160173
**Listener Settings** specifies the listener settings for the Server.
161174

162-
**Handshake timeout** specifies the timeout of the handshake when the client establishes a WebSocket connection to the server.
175+
**Handshake timeout (5000 ms)** specifies the timeout of the handshake when the client establishes a WebSocket connection to the server.
163176

164177
**Receive Server Enqueuer Handler** specifies the concrete message (to be created) child of the abstract message “*WebSocket Server-Service Enqueuer Msg.lvclass*”.
165178

@@ -168,7 +181,7 @@ alt="A screenshot of a computer Description automatically generated" />
168181
<img src="./media/image4.png" style="width:4.5754in;height:2.87525in"
169182
alt="A computer screen shot of a message Description automatically generated" />
170183

171-
**Subscriber Enqueuer** specifies the enqueuer of the actor that has subscribed to the previously launched "WebSocket Server" actor.
184+
**Subscriber Enqueuer** specifies the enqueuer of the actor that will receive an error if a server with such listener settings is not running. Such actor must have subclassed the abstract message WebSocket *Server-Service Enqueuer Msg.lvclass*
172185

173186
**Message Enqueuer in** specifies the enqueuer of the "WebSocket Server Manager" actor to be stopped.
174187

Binary file not shown.

WebSocket Actor/Keepalive Heartbeat Messages/Report Pong Msg/Report Pong Msg.lvclass

Lines changed: 16 additions & 12 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.

WebSocket Actor/WebSocket Server Manager Messages/Launch Server Msg/Launch Server Msg.lvclass

Lines changed: 7 additions & 7 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)