I need help.
sgcWebSocketServer
when server shutdown accidently
i try reconnect unable to continue previous rpc call
what the problem?
i have few transaction to save
line 1,2,3 was saved but when line 4 the server shutdown accidently
and after this i unable to continue next action.
here is function call ,please help
if DM.wsClient.Active = false then
begin
DM.wsClient.Host := '192.168.1.123';
DM.wsClient.Port := 8181;
try
DM.wsClient.Active := True;
if not DM.wsClient.Active then
fnShowMessage('Server not respond!', C_ERROR);
finally
end;
end;
if strJSON <> '' then begin
DM.wspProtocol.RPC(FUUID, 'save', strJSON);
You just need to configure your client to pass some type of identification, so the server when this client connects, stores the required data in a database. Every time the client interactuates with the server, store the data/state in the database, so if there is any disconnection, the client re-connects passing the same identification and the server can continue the process.
I am sorry but when a client disconnects (or server closes), the session is deleted, so there is no built-in mechanism to continue the session when it was closed. Although you can implement your own methods to store "sessions", this will require to use for example a database where a session id is stored and when the client reconnects, it passes this session id and the server restore the "session", so it can continue the process.
Kind Regards,
Sergio
Sorry may bad english,
mean example i have 5 item sales in 1 invoice
i entry item 1,2,3 but during item 4 entry server shut down accidently and client need reconnect to server
after reconnect should be able continue item 4,item 5 to that invoice from client.
but fail to entry item 4,5 , i have to close and reopen again only able continue.
thanks