Websocket Prototype

This commit is contained in:
René Linder 2023-03-31 12:46:49 +02:00
parent 8574b29021
commit d1b24f5f97
2 changed files with 132 additions and 114 deletions

View file

@ -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

222
lweb.pbp
View file

@ -8,125 +8,129 @@
<section name="data">
<explorer view="../../../bin/purebasic/examples/" pattern="0"/>
<log show="1"/>
<lastopen date="2023-03-30 15:54" user="renlin" host="renlin-home"/>
<lastopen date="2023-03-31 12:45" user="renlin" host="localhost.localdomain"/>
</section>
<section name="files">
<file name="installation.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="1" panelstate="+"/>
<fingerprint md5="7a7390738d301d57e4eb8b28373d22e7"/>
</file>
<file name="server_example.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="2" panelstate="+"/>
<fingerprint md5="60fb2a5c112ead2c297cce2afa908ea4"/>
</file>
<file name="lhttpd.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="3" panelstate="+"/>
<fingerprint md5="ac30ebe9e15805d02ec78fe3dd5a9441"/>
</file>
<file name="lweb_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="4" panelstate="+"/>
<fingerprint md5="53bf42c3a6e95d381fa49bc2d076946b"/>
</file>
<file name="inc/lweb_header_privat.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="5" panelstate="+-"/>
<fingerprint md5="c4a9ada9f85b43584cc6e154d6465fdf"/>
</file>
<file name="inc/lweb_server_cfg.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="6" panelstate="+-"/>
<fingerprint md5="fae18222c1c6f8e241bfc06f9bb00659"/>
</file>
<file name="inc/lweb_server_cfg_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="7" panelstate="+-"/>
<fingerprint md5="57787e1e3db6c77d81fc5576e124beae"/>
</file>
<file name="build_tools/src/default_host_xml_export.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="8" panelstate="+--"/>
<fingerprint md5="e3e8de2f4e852905bf6410aad61d5565"/>
</file>
<file name="build_tools/src/status_xml_export.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="9" panelstate="+--"/>
<fingerprint md5="b8282147d13a268e39f6164f684c3169"/>
</file>
<file name="inc/lcmf_main.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="10" panelstate="+-"/>
<fingerprint md5="07b859104cbf3ef2df0b8a9cf3eeab32"/>
</file>
<file name="inc/lweb_file_cache.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="11" panelstate="+-"/>
<fingerprint md5="a3c3072e4eb0a8d09d9e02b2d57b707d"/>
</file>
<file name="inc/lweb_helper.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="12" panelstate="+-"/>
<fingerprint md5="944c758e53a2b9d4bcf28ef931179d31"/>
</file>
<file name="inc/lweb_http.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="13" panelstate="+-"/>
<fingerprint md5="a42cddb6a1102779589facc17ba96cd8"/>
</file>
<file name="inc/lweb_http_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="14" panelstate="+-"/>
<fingerprint md5="d7df8e152291b0f91e8316ad8e00191c"/>
</file>
<file name="inc/lweb_http_status.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="15" panelstate="+-"/>
<fingerprint md5="cabf767d4a63c045f9ac4e7ca9e8f303"/>
</file>
<file name="inc/lweb_http_status_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="16" panelstate="+-"/>
<fingerprint md5="ad8d9313172646d803164eaa5431d2f4"/>
</file>
<file name="inc/lweb_http_status_header_private.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="17" panelstate="+-"/>
<fingerprint md5="c7736a7cdc87c1ed676b17d9757ba135"/>
</file>
<file name="inc/lweb_IP.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="18" panelstate="+-"/>
<fingerprint md5="502f26844f0a4b7d7f25924f76b17473"/>
</file>
<file name="inc/lweb_IP_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="19" panelstate="+-"/>
<fingerprint md5="636558037ff2cab03552fb129e2a4f52"/>
</file>
<file name="lhs_lib/SYS/lhs_log_ext.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="20" panelstate="+--"/>
<fingerprint md5="f37e027dbab8be85535563b3287f7fff"/>
</file>
<file name="lhs_lib/SYS/lhs_sys_debug_wrapper.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="21" panelstate="+--"/>
<fingerprint md5="8c3a929cf403d443ec968d21593294a5"/>
</file>
<file name="lhs_lib/NET/lhs_net_socket.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="22" panelstate="+--"/>
<fingerprint md5="3674a9181dad4f9f42c6eb9e7c407986"/>
</file>
<file name="lhs_lib/NET/lhs_net_tls.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="23" panelstate="+--"/>
<fingerprint md5="c586d25a1493f437c7461374a891a715"/>
</file>
<file name="server_example_function.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="24" panelstate="+"/>
<fingerprint md5="5265cbd658ef5ff271bd2c6ea30b5713"/>
</file>
<file name="server_example_function_library.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="25" panelstate="+"/>
<fingerprint md5="89b911359d8203d81c3aabbbd6f0dcf1"/>
</file>
<file name="lweb.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="26" panelstate="+"/>
<fingerprint md5="36635c3e76e0e477b5537b703edb3ce5"/>
</file>
<file name="inc/lweb_helper_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="27" panelstate="+-"/>
<fingerprint md5="c250ce791b691f679782e5016a3346be"/>
</file>
<file name="lhs_lib/NET/lhs_web_helper.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="28" panelstate="+--"/>
<fingerprint md5="52ed1675b88a463b7ada8cf2003430e1"/>
</file>
<file name="build_tools/src/default_config_xml_export.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="0" sortindex="999" panelstate="+--"/>
<fingerprint md5="03c865cac19c1ef8148ac229388df3b0"/>
</file>
<file name="build_tools/src/default_host_xml_export.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="17" panelstate="+--"/>
<fingerprint md5="e3e8de2f4e852905bf6410aad61d5565"/>
</file>
<file name="build_tools/src/status_xml_export.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="18" panelstate="+--"/>
<fingerprint md5="b8282147d13a268e39f6164f684c3169"/>
</file>
<file name="inc/lcmf_main.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="19" panelstate="+-"/>
<fingerprint md5="07b859104cbf3ef2df0b8a9cf3eeab32"/>
</file>
<file name="inc/lweb_file_cache.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="20" panelstate="+-"/>
<fingerprint md5="a3c3072e4eb0a8d09d9e02b2d57b707d"/>
</file>
<file name="inc/lweb_file_cache_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="0" sortindex="999" panelstate="+-"/>
<fingerprint md5="3228c16f329808e2e6e3c6866861ae59"/>
</file>
<file name="inc/lweb_header_privat.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="14" panelstate="+-"/>
<fingerprint md5="c4a9ada9f85b43584cc6e154d6465fdf"/>
</file>
<file name="inc/lweb_helper.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="21" panelstate="+-"/>
<fingerprint md5="944c758e53a2b9d4bcf28ef931179d31"/>
</file>
<file name="inc/lweb_helper_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="0" sortindex="999" panelstate="+-"/>
<fingerprint md5="c250ce791b691f679782e5016a3346be"/>
</file>
<file name="inc/lweb_http.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="22" panelstate="+-"/>
<fingerprint md5="a42cddb6a1102779589facc17ba96cd8"/>
</file>
<file name="inc/lweb_http_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="23" panelstate="+-"/>
<fingerprint md5="d7df8e152291b0f91e8316ad8e00191c"/>
</file>
<file name="inc/lweb_http_status.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="24" panelstate="+-"/>
<fingerprint md5="cabf767d4a63c045f9ac4e7ca9e8f303"/>
</file>
<file name="inc/lweb_http_status_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="25" panelstate="+-"/>
<fingerprint md5="ad8d9313172646d803164eaa5431d2f4"/>
</file>
<file name="inc/lweb_http_status_header_private.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="26" panelstate="+-"/>
<fingerprint md5="c7736a7cdc87c1ed676b17d9757ba135"/>
</file>
<file name="inc/lweb_IP.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="27" panelstate="+-"/>
<fingerprint md5="502f26844f0a4b7d7f25924f76b17473"/>
</file>
<file name="inc/lweb_IP_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="28" panelstate="+-"/>
<fingerprint md5="636558037ff2cab03552fb129e2a4f52"/>
</file>
<file name="lhs_lib/SYS/lhs_log_ext.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="29" panelstate="+--"/>
<fingerprint md5="f37e027dbab8be85535563b3287f7fff"/>
</file>
<file name="lhttpd.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="9" panelstate="+"/>
<fingerprint md5="ac30ebe9e15805d02ec78fe3dd5a9441"/>
</file>
<file name="lweb.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="13" panelstate="+"/>
<fingerprint md5="31b36b0d01b375b7b31f18472ed14b7c"/>
</file>
<file name="lweb_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="12" panelstate="+"/>
<fingerprint md5="919a07a4b60b18db11f1535249e93dea"/>
</file>
<file name="server_example.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="8" panelstate="+"/>
<fingerprint md5="60fb2a5c112ead2c297cce2afa908ea4"/>
</file>
<file name="server_example_function.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="36" panelstate="+"/>
<fingerprint md5="5265cbd658ef5ff271bd2c6ea30b5713"/>
</file>
<file name="lhs_lib/NET/lhs_net_tls.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="34" panelstate="+--"/>
<fingerprint md5="c586d25a1493f437c7461374a891a715"/>
</file>
<file name="lhs_lib/NET/lhs_net_socket.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="33" panelstate="+--"/>
<fingerprint md5="3674a9181dad4f9f42c6eb9e7c407986"/>
</file>
<file name="lhs_lib/SYS/lhs_sys_debug_wrapper.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="31" panelstate="+--"/>
<fingerprint md5="8c3a929cf403d443ec968d21593294a5"/>
</file>
<file name="inc/lweb_server_cfg.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="15" panelstate="+-"/>
<fingerprint md5="fae18222c1c6f8e241bfc06f9bb00659"/>
</file>
<file name="inc/lweb_server_cfg_header.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="16" panelstate="+-"/>
<fingerprint md5="57787e1e3db6c77d81fc5576e124beae"/>
</file>
<file name="server_example_function_library.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="37" panelstate="+"/>
<fingerprint md5="89b911359d8203d81c3aabbbd6f0dcf1"/>
</file>
<file name="installation.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="7" panelstate="+"/>
<fingerprint md5="7a7390738d301d57e4eb8b28373d22e7"/>
</file>
</section>
<section name="targets">
<target name="Standard-Ziel" enabled="1" default="0">