1. Daniel Kluss EU web server
- Posted by ChrisB (moderator) Aug 12, 2008
- 1240 views
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
2. Re: Daniel Kluss EU web server
- Posted by codepilot Aug 22, 2008
- 1184 views
Hmm, I've been working on it a bit lately, let me see what I can find for you.
3. Re: Daniel Kluss EU web server
- Posted by codepilot Aug 22, 2008
- 1181 views
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.
4. Re: Daniel Kluss EU web server
- Posted by ChrisB (moderator) Aug 22, 2008
- 1173 views
- Last edited Aug 23, 2008
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
5. Re: Daniel Kluss EU web server
- Posted by ChrisB (moderator) Aug 22, 2008
- 1164 views
- Last edited Aug 23, 2008
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)
6. Re: Daniel Kluss EU web server
- Posted by codepilot Aug 22, 2008
- 1193 views
- Last edited Aug 23, 2008
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.
7. Re: Daniel Kluss EU web server
- Posted by codepilot Aug 22, 2008
- 1178 views
- Last edited Aug 23, 2008
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]
8. Re: Daniel Kluss EU web server
- Posted by ChrisB (moderator) Aug 23, 2008
- 1164 views
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
9. Re: Daniel Kluss EU web server
- Posted by ChrisB (moderator) Aug 23, 2008
- 1154 views
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
10. Re: Daniel Kluss EU web server
- Posted by codepilot Aug 23, 2008
- 1191 views
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/".
11. Re: Daniel Kluss EU web server
- Posted by ChrisB (moderator) Aug 23, 2008
- 1162 views
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
12. Re: Daniel Kluss EU web server
- Posted by codepilot Aug 23, 2008
- 1137 views
- Last edited Aug 24, 2008
Well that is what it's for, just for learning and fiddling.