Page 12 of 12

Re: atomic web server threads

Posted: Sun Feb 22, 2026 12:25 am
by idle
If you want the server visible over lan set the server ip address to the servers ip interface eg 192.168.1.x
Then from your remote pc navigate to 192.168.1.x/indexof

The example I showed will host the files under the folder you create the executable in so set compiler option to create exe in source folder rather than temporary. Create the www folder in that source folder and add your files there.
So for local or lan by ip address the folder structure is
Www/files

If make wget 192.168.1.x/indexof I assume it will fetch all the files as it dynamicly links them.

Re: atomic web server threads

Posted: Sun Feb 22, 2026 1:24 am
by matalog
Idle, that's amazing, thanks. It's almost working.

If I change the port to 80 instead of 8080 on the last program you sent it mostly works.

I will need to change the timeout time because my ZX Spectrum doesn't get the entire 6MB image within the time your server allows. It seems to get about 1.2MB of the 6MB image in the case that I am testing.

Where is the timeout time set? In The 'atomic_web_server3.pbi' file or the new indexing file you sent?

Re: atomic web server threads

Posted: Sun Feb 22, 2026 2:03 am
by idle
matalog wrote: Sun Feb 22, 2026 1:24 am Idle, that's amazing, thanks. It's almost working.

If I change the port to 80 instead of 8080 on the last program you sent it mostly works.

I will need to change the timeout time because my ZX Spectrum doesn't get the entire 6MB image within the time your server allows. It seems to get about 1.2MB of the 6MB image in the case that I am testing.

Where is the timeout time set? In The 'atomic_web_server3.pbi' file or the new indexing file you sent?
I don't think it will be the server timing out that's 15000 default and is updated every time data is sent
you can try

wget --timeout=15 --tries=5 -r --follow-tags=a http://192.168.1.x

I don't know why the forum is so slow probably AI bot crawlers.

Re: atomic web server threads

Posted: Sun Feb 22, 2026 10:13 pm
by matalog
matalog wrote: Sun Feb 22, 2026 1:24 am I don't think it will be the server timing out that's 15000 default and is updated every time data is sent
you can try

wget --timeout=15 --tries=5 -r --follow-tags=a http://192.168.1.x

I don't know why the forum is so slow probably AI bot crawlers.
Yes, if I increase the timeout (or all instances of 15000) in "atomic_web_server3.pbi" then it transfers entirely, but the download doesn't finish nicely.

When it is finished, the spectrum would usually say file saved, but with this server, it just hangs on the progress bar.

Is there an alternative way to terminate the data transfer?

Re: atomic web server threads

Posted: Sun Feb 22, 2026 11:06 pm
by idle
I don't know what's going on you can debug the requests
also when it doesn't know the file type it defaults the mime type to "text/html"

what is wget requesting? maybe that will shed some light on the issue

Code: Select all

;call back for get and post  
Procedure CBPostGet(*request.Atomic_Server_Request) 
  
  
  Debug *request\Type 
  Debug *request\Request
  
  Debug "params:" 
  
  ForEach *request\parameters()
    Debug MapKey(*request\parameters()) + " = " + *request\parameters()
  Next 
  
  Debug "headers:" 
  ForEach *request\RequestHeaders() 
    Debug MapKey(*request\RequestHeaders()) + " = " + *request\RequestHeaders()
  Next   
    
EndProcedure   

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

Re: atomic web server threads

Posted: Mon Feb 23, 2026 12:12 am
by matalog
That code change didn't debug much. It just said "/s.jpg".

I have tried jpgs, which I think is a known file type, png and bmp.

They all don't finish on the Spectrum. I noticed that when I exit the server then the Spectrum says "File Saved" and ends correctly.

Is there a way to have the server simulate the program closing when the download is finished?

Re: atomic web server threads

Posted: Mon Feb 23, 2026 6:59 pm
by Kwai chang caine
Waouh !!! your site is splendid !!! understated and classy :shock: i love it 8)
I have run the PB code and it say the 80 port is occuped :oops: and i not believe have another curent server

Re: atomic web server threads

Posted: Mon Feb 23, 2026 8:41 pm
by idle
Shouldn't be an issue on windows but linux will block port 80 unless it's run elevated.
Last update was for pb 6.20 though I'm using 6.30 and also tested 6.40 with minor change.

Re: atomic web server threads

Posted: Wed Feb 25, 2026 6:22 pm
by Kwai chang caine
Waouh...waoouuuuh and I would even say ...waoouuuuh !!! :shock:

Before i use the 6.21 x86 :wink:
With 6.30....that works exactely like on your site :shock: but in my home at me :mrgreen:

I can't believe how beautiful it is! 8)
But i not dare to look into your WEB code :oops: , surely a plane with powerful library, for can do this splendids effects 8)
It's a real change from my Web 1.0 sites with inline style :lol:

Code: Select all

<body bgcolor="#006600">
		<div style="text-align:center; margin:20px"><img src="/Donnees/Medias/Images/Vignettes/Vignette1.jpg" width="450" height="675"></DIV>
		<div style="text-align:center; text-shadow:6px 6px 8px black; font-size:40px; color:white; margin-bottom:100px">1 - Ambulance (4221)</div>
		<div style="text-align:center; margin:20px"><img src="/Donnees/Medias/Images/Vignettes/Vignette2.jpg" width="450" height="372"></DIV>
		<div style="text-align:center; text-shadow:6px 6px 8px black; font-size:40px; color:white; margin-bottom:100px">2 - Animaux de la forĂȘt (3006)</div>
		<div style="text-align:center; margin:20px"><img src="/Donnees/Medias/Images/Vignettes/Vignette3.jpg" width="450" height="370"></DIV>
		...........................
Tim Berners-Lee would be surely proud of KCC :mrgreen:

Image

i'm always the CERBER of his original language :D

Image

Thanks a lot MASTER for this great and amazing sharing 8)

Re: atomic web server threads

Posted: Wed Feb 25, 2026 8:56 pm
by idle
Hi Kcc
The html template is Hyperspace by HTML5 UP
html5up.net Free for personal and commercial use under the CCA 3.0 license

Re: atomic web server threads

Posted: Wed Feb 25, 2026 10:23 pm
by infratec