Page 6 of 9

Re: atomic web server threads

Posted: Sat Apr 20, 2024 7:38 pm
by Caronte3D
Good news! :D
I will test it next week.
Thanks! :wink:

Re: atomic web server threads

Posted: Fri Apr 26, 2024 3:42 am
by idle
Version 3.0.9b1
Added SSL, Linux x64 and Windows x86 x64, should run on win7+
seems to be working ok, running here
https://atomicwebserver.com

code linked in 1st post

Re: atomic web server threads

Posted: Fri Apr 26, 2024 7:13 am
by HeX0R
You've meant https://atomicwebserver.com/
(you need sharp glasses to see the difference :mrgreen: )

Re: atomic web server threads

Posted: Fri Apr 26, 2024 7:29 am
by idle
HeX0R wrote: Fri Apr 26, 2024 7:13 am You've meant https://atomicwebserver.com/
(you need sharp glasses to see the difference :mrgreen: )
thanks, yes I need glasses. 8)

Re: atomic web server threads

Posted: Fri Apr 26, 2024 7:53 am
by Caronte3D
Image

Re: atomic web server threads

Posted: Fri Apr 26, 2024 8:33 am
by idle
It's almost there but still some bugs to track down.

Re: atomic web server threads

Posted: Fri Apr 26, 2024 9:49 am
by Caronte3D
Yes, the fact that the sessionID cookie doesn't remove when the web browser is closed is a pain because you don't know if a request is on the same session or another one.

Anyway, the work you are doing is awesome and... you are very fast implementing needed features 8)

Re: atomic web server threads

Posted: Fri Apr 26, 2024 10:34 am
by idle
Caronte3D wrote: Fri Apr 26, 2024 9:49 am Yes, the fact that the sessionID cookie doesn't remove when the web browser is closed is a pain because you don't know if a request is on the same session or another one.

Anyway, the work you are doing is awesome and... you are very fast implementing needed features 8)
I will try adding an absolute expires.
If a cookie is set without max-age or expires it will delete as soon as the connection is closed but currently I'm not honoring keep alive requests and will close a connection after 10 second idle which is more to do making sure I have no memory leaks. I will address it soon enough.

Re: atomic web server threads

Posted: Fri Apr 26, 2024 2:35 pm
by skinkairewalker
Amazing.
Image

Re: atomic web server threads

Posted: Sat Apr 27, 2024 12:50 am
by idle
added mutexs to tls.pbi

Re: atomic web server threads

Posted: Sat Apr 27, 2024 8:22 am
by jamirokwai
Currently, I can't open pages locally on macOS. Will try again next week. Maybe, I need to change the host as written in the examples.

But: When starting any of the examples, it throws an error at line 485:

; MessageRequester(*Atomic_Server\Title, "Error: can't create the server (port " + *Atomic_Server\port + " in use ?)")

[09:20:04] Executable type: MacOSX - arm64 (64bit, Unicode, Thread)
[09:20:04] Executable started.
[09:20:04] [ERROR] Atomic_Web_Server3.pbi (Line: 485)
[09:20:04] [ERROR] NSWindow should only be instantiated on the main thread!
[09:20:06] The Program was killed.

Edit: Just downloaded the current version from GitHub, the NSWindow-error is gone for the moment.

Re: atomic web server threads

Posted: Sat Apr 27, 2024 10:48 am
by idle
jamirokwai wrote: Sat Apr 27, 2024 8:22 am Currently, I can't open pages locally on macOS. Will try again next week. Maybe, I need to change the host as written in the examples.

But: When starting any of the examples, it throws an error at line 485:

; MessageRequester(*Atomic_Server\Title, "Error: can't create the server (port " + *Atomic_Server\port + " in use ?)")

[09:20:04] Executable type: MacOSX - arm64 (64bit, Unicode, Thread)
[09:20:04] Executable started.
[09:20:04] [ERROR] Atomic_Web_Server3.pbi (Line: 485)
[09:20:04] [ERROR] NSWindow should only be instantiated on the main thread!
[09:20:06] The Program was killed.

Edit: Just downloaded the current version from GitHub, the NSWindow-error is gone for the moment.
I had the same issue on linux and adding ./ to the paths fixed the issues but I may have missed adding the fixes as I'm working on two branches and the test site is different to the live site.
I will try and test it tomorrow on osx just need to get the lap top off the wife

Re: atomic web server threads

Posted: Wed May 01, 2024 1:56 am
by idle
Version 3.0.10b1

Reverted to single threads per client as multiple request threads per client were getting into contention on linux and causing a high cpu load.

Re: atomic web server threads

Posted: Sat May 04, 2024 3:00 am
by idle
Version 3.1.0b1

Added the virtual file system, this is pretty much it feature wise and can now undergo refinements. The virtual file system will eventually be replaced with a streamlined version if and when time allows.

To use the virtual file system you just need to create a pack with a call to Atomic_Server_Create_Pack() with your www directory, then include the .ezp file in data section then recompile and you've got all your assets in a virtual file system so you can use it to host the content to a web gadget and distribute as a single executable with no dependencies.
example of use is in single_server_localhost.pb repo has prepacked site in the .ezp

Code: Select all

Global server1 = Atomic_Server_Init("atomic_webserver","./www/","127.0.0.1","",80,#PB_Network_IPv4,5000,@CBPostGet(),@CBPostGet()) 

Atomic_Server_Create_Pack(server1) ;use this to pack the www folder and then include the binary comment it out and recomplie    

Atomic_server_Set_PackAddress(server1,?Index,?EndIndex-?Index) ;set the pack address and size 

OpenConsole() 

If Atomic_Server_Start(server1,-1,1)  ;start server no window logs to console 
  Repeat 
  Until Input() = "quit"   ;type quit to exit 
  Atomic_Server_Exit(server1)
  CloseConsole()
EndIf 

DataSection 
  Index:
  IncludeBinary "./www.ezp"
  EndIndex:
EndDataSection 


Re: atomic web server threads

Posted: Sun May 05, 2024 12:38 am
by idle
bug fixes, it finally seems to be stable on linux had to widen the scope of mutexes in tls.pbi

Version 3.1.0b3 fixed close connection on no data received