1. Daniel Kluss EU web server

Hi

Is Daniel still about? Does he, or anyone, use his web server?

I modified it slightly (onEvent to setHandler) to work with win32lib version 0703, it starts and sits waiting fine, but I can't seem to get it to return any web pages?

Thanks in advance.

Chris

new topic     » topic index » view message » categorize

2. Re: Daniel Kluss EU web server

Hmm, I've been working on it a bit lately, let me see what I can find for you.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Daniel Kluss EU web server

Make sure that onRecv_EuWeb is being called, did it work and test with http://127.0.0.1/ that is the default host. You can email me I'm codepilot using Google's mail.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Daniel Kluss EU web server

Hi Daniel, nice to see you're still here

A quick couple of tests

procedure onRecv_EuWeb(integer iMsg, atom socket, atom event ) 
        atom hdc,VOID,temp_mem,t,len,cur 
        object temp,data 
puts(1, "Message recieved\n") 
        if iMsg !=MyRecv then return end if 

prints the message to the console

procedure onRecv_EuWeb(integer iMsg, atom socket, atom event ) 
        atom hdc,VOID,temp_mem,t,len,cur 
        object temp,data 
 
        if iMsg !=MyRecv then return end if 
puts(1, "Message recieved\n") 

Doesn't print a message

MyRecv = 55 as a global constant

Thanks for looking at this.

Chris

new topic     » goto parent     » topic index » view message » categorize

5. Re: Daniel Kluss EU web server

and this is what I modified the callers to

--onResize[EuWeb]=routine_id("onResize_EuWeb") 
setHandler(EuWeb, w32HClick, {-1, routine_id("onResize_EuWeb")} ) 
--onOpen[EuWeb]=routine_id("onOpen_EuWeb") 
setHandler(EuWeb, w32HOpen, {-1, routine_id("onOpen_EuWeb")} ) 
--onClose[EuWeb]=routine_id("onClose_EuWeb") 
setHandler(EuWeb, w32HClose, {-1, routine_id("onClose_EuWeb")} ) 
--onEvent[EuWeb]=routine_id("onRecv_EuWeb") 
setHandler(EuWeb, w32HEvent, {-1, routine_id("onRecv_EuWeb")} ) 
--onTimer[EuWeb]=routine_id("onTimer_EuWeb") 
setHandler(EuWeb, w32HTimer, {-1, routine_id("onTimer_EuWeb")} ) 
WinMain(EuWeb,Normal) 
new topic     » goto parent     » topic index » view message » categorize

6. Re: Daniel Kluss EU web server

I think the problem comes from the agument list it is this

procedure onRecv_EuWeb(integer iMsg, atom socket, atom event )

but should be this

procedure onRecv_EuWeb(atom self, atom event, sequence params) integer iMsg, atom socket, atom event iMsg=params[1] socket=params[2] event=params[3]

something like that should work better I think I haven't used this code in many years, I'm working on a version that uses euphoria tasks and windows threads.

new topic     » goto parent     » topic index » view message » categorize

7. Re: Daniel Kluss EU web server

I tested it and it works, replace the first few lines of onRecv_EuWeb with this, and your setHandler changes of course.

was this

procedure onRecv_EuWeb(integer iMsg, atom socket, atom event ) 
        atom hdc,VOID,temp_mem,t,len,cur 
        object temp,data 

now this

procedure onRecv_EuWeb(atom self, atom wevent, sequence params) 
	integer iMsg 
	atom socket 
	atom event 
	atom hdc,VOID,temp_mem,t,len,cur 
	object temp,data 
   	iMsg=params[1] 
	socket=params[2] 
	event=params[3] 
new topic     » goto parent     » topic index » view message » categorize

8. Re: Daniel Kluss EU web server

Hi

Of course! - I've modified enough onEvent to setHandlers to know better. Many thanks. (I haven't tested it yet, but if it doen't work I'll let you know, though I would be very surprised if it doesn't)

Chris

new topic     » goto parent     » topic index » view message » categorize

9. Re: Daniel Kluss EU web server

Hi

Ah, spoke too soon

The server now responds with a directory listing of the home folder, but then nothing.

I added this

procedure monitor(sequence msg) 
        puts(1, msg & "\n") 
end procedure 

then

	event=params[3]  
 
        if event > 0 then  
                monitor(sprintf("%d - message received", {event})) 
        end if 
 

and for each of the event ifs

        if event=FD_ACCEPT then 
                monitor("FD_ACCEPT") 

and so on.

It serves the index.html web page back with 127.0.0.1/index, but not 127.0.0.1
Whats more, once you've loaded the page, there seems to no further response.
And I've just discovered that trying to run a CGI program freezes the server

I don't want to distract you from updating the server for threads, and any other projects you may have on the go, so for now, and experimentation purposes, I'll just use the Xitami web server.

Thanks anyway

Chris

new topic     » goto parent     » topic index » view message » categorize

10. Re: Daniel Kluss EU web server

I always like Apache myself, it works pretty well on windows. I wouldn't consider my server's code production quality, more neglected hobby quality. Here is my current test version 1 "http://jedans.com/http/httpserver_tv1.zip". It justs needs me to copy into it the CGI and File handling, and everything else. It's real short and just spits out "DataDataDataDataData" for "http://127.0.0.1/".

new topic     » goto parent     » topic index » view message » categorize

11. Re: Daniel Kluss EU web server

codepilot said...

I wouldn't consider my server's code production quality, more neglected hobby quality.

And yet very interesting nevertheless. This will be something (yet another) something that I will keep on coming back to and fiddling with, just to gain an understanding as much as anything else.

Regards

Chris

new topic     » goto parent     » topic index » view message » categorize

12. Re: Daniel Kluss EU web server

Well that is what it's for, just for learning and fiddling.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu