atomic web server threads

Share your advanced PureBasic knowledge/code with the community.
User avatar
skinkairewalker
Addict
Addict
Posts: 805
Joined: Fri Dec 04, 2015 9:26 pm

Re: atomic web server threads

Post by skinkairewalker »

Is it possible for us to create a web server that is compatible with all operating systems using the PureBasic network library?
And if we remove complex structures and leave only the HTTP server for the local network? I think that this way we can make protected web apps with webview — or am I wrong?

in MacOS (ARM) occurs :
Image


in linux (ARM with parallels desktop) occurs :
Image
User avatar
idle
Always Here
Always Here
Posts: 6064
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: atomic web server threads

Post by idle »

Yes you can use it to serve on localhost to serve to either a web gadget or users browser.
It looks like the static lib is missing a dependency on the linux system.

I haven't tested on arm recently and I don't have access to a Mac to test on.
Did you try with a lower port number like 8081 ?
Also if your not using tls find the usetls() and comment it out as there's no point using tls on localhost or loopback.
User avatar
skinkairewalker
Addict
Addict
Posts: 805
Joined: Fri Dec 04, 2015 9:26 pm

Re: atomic web server threads

Post by skinkairewalker »

Strange behavior on Linux, the dependency is installed.
What could be calling this dependency?
Image
User avatar
idle
Always Here
Always Here
Posts: 6064
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: atomic web server threads

Post by idle »

it's missing a dependency. I can't help you with that at the moment though.
User avatar
mk-soft
Always Here
Always Here
Posts: 6373
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: atomic web server threads

Post by mk-soft »

Mint Linux LMDE 7 (Debian 13)
With TLS Server I always have with TLS functions "Invaild Memory Access", but have an address after importing to the function?

Other thing:
With linux you should not call the MessageRequester from a thread (crash)

Fix for Linux

Code: Select all

CompilerIf #PB_Compiler_OS = #PB_OS_Linux
  Procedure MyMessageRequester(Title.s, Text.s, Flags=0)
    Protected r1
    gdk_threads_enter_();
    r1 = MessageRequester(Title, Text, Flags)
    gdk_flush_()
    gdk_threads_leave_()
    ProcedureReturn r1
  EndProcedure
  
  Macro MessageRequester(Title, Text, Flags=0)
    MyMessageRequester(Title, Text, Flags)
  EndMacro
CompilerEndIf
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
infratec
Always Here
Always Here
Posts: 7679
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: atomic web server threads

Post by infratec »

Maybe you need

libbsd-dev (libbsd)

in ubuntu.
User avatar
skinkairewalker
Addict
Addict
Posts: 805
Joined: Fri Dec 04, 2015 9:26 pm

Re: atomic web server threads

Post by skinkairewalker »

infratec wrote: Mon Nov 17, 2025 9:55 am Maybe you need

libbsd-dev (libbsd)

in ubuntu.
I achieved the goal I was aiming for xD
My only concern is that the code is quite "unprofessional" :
viewtopic.php?t=87904
Post Reply