AnsweredAssumed Answered

GW 9.2 websocket behavior ?

Question asked by Michael Mueller Employee on Aug 16, 2018
Latest reply on Aug 21, 2018 by Michael Mueller

Hi Team.
I'd like to have your point of view/understanding regarding GW (9.2) websocket handling.

To start, here is a scenario I observed:

A websocket client is opening a ws connection (lets say the frontend ws connection) to the GW.
At the same time the GW is opening a ws connection (lets say the backend ws connection) to the backend.

So far so good .

if the client sends data to the GW through the frontend ws the GW sends the same data to the backend ws
And the backend might answer to this incoming data through the backend ws to the GW , which gets forwarded through the frontend ws to the client.


Now it comes to two specific situations the customer has implemented.


1) The customers implementation of the backend ws service closes the backend ws connection, if there is no appropriate/expected traffic.
This seems to be not a problem for the GW. The frontend ws stays open ! and as soon the client sends again some data, the GW will open a new ws connection to the backend and forward the data.


2) the customers client app is sending some authentication information in its first message to the GW/backend.
That means, the backend authenticates the connection by evaluating the first client message, and seems to store the relationship between this current ws connection and the authentication.
Further messages from the client do not contain authentication information. ( like a telnet , first login, then the session is authenticated as long it is available) .

But now, if the backend closes the backend ws connection due to inactivity, and the GW leaves the frontend connection open, we run into a problem.
The client is not able to recognize, that the backend has closed the connection.
So if the client now sends some data (without authentication information) the GW will create a new backend ws connection, and forward the data to the backend.
But for the backend this is a new connection. So he expects the authentication information, which is not included in the client data.


long speak, short meaning:


Shouldn't the GW close the frontend ws connection, when it recognize the closing of the backend ws connection ?
Only then the client is able to recognize, what is going on behind the scenes, and would be able to establish a new connection.

Thanks for thoughts and comments