From d1b24f5f9730ff11faede7d7d4e1149b5e37985e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Linder?= Date: Fri, 31 Mar 2023 12:46:49 +0200 Subject: [PATCH] Websocket Prototype --- lweb.pbi | 24 ++++-- lweb.pbp | 222 ++++++++++++++++++++++++++++--------------------------- 2 files changed, 132 insertions(+), 114 deletions(-) diff --git a/lweb.pbi b/lweb.pbi index 3efba0f..9696e17 100644 --- a/lweb.pbi +++ b/lweb.pbi @@ -517,7 +517,24 @@ Module lhs_web EndIf ForEver EndProcedure - + + Procedure server_WebSocket(network_client_id) + Protected Quit = 1 + Protected.i thread_cli_id = network_client_id + + Repeat + ; Check if we get data from client + If m_clients(Str(thread_cli_id))\client_type = #client_HTTPS + temp_receivelength = tls::ReadTLSSocket(thread_cli_id, m_clients(Str(thread_cli_id))\datenbuffer()\Buffer, 65536) + Else + temp_receivelength = lsocket::ReadSocket(thread_cli_id, m_clients(Str(thread_cli_id))\datenbuffer()\Buffer, 65536) + + EndIf + ; Check if Library has data to send + + Until Quit = 1 + EndProcedure + Procedure client(network_client_id.i) Protected thread_cli_id = network_client_id, sent Protected MyThreadJSON, ToCall, ToCallType @@ -696,13 +713,10 @@ Module lhs_web ;Detect if whe have a library who react to there: ToCallType = call_request(Host_call + thread_requested, #get_handler_prototype) If ToCallType = #handler_proto_i_get Or ToCallType = #handler_proto_get + ;Call Websocket EndIf - - EndIf - - EndIf Else diff --git a/lweb.pbp b/lweb.pbp index 635cbff..76c0453 100644 --- a/lweb.pbp +++ b/lweb.pbp @@ -8,125 +8,129 @@
- +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -