You can create a thread and define Wrun as the starting function.

Regards
Raph

On Thu, May 29, 2008 at 8:03 AM, Koen Deforche <[EMAIL PROTECTED]> wrote:

> Hey Michael,
>
> 2008/5/28 Michael Medin <[EMAIL PROTECTED]>:
> > Anyways are there any info/samples on how to use the built in http
> server?
> > I tried to look around a bit but it seemed all examples assumed the
> > program was a "stupid demon" as they all did
> > void main(void) {
> > Wrun(...);
> > }
> >
> > I need to start the server and continue with my own work and also be
> > able to shut it down and what not when I want to.
> > When I tried to do this (I copied the code from Wrun) it seemed to
> > require me to include much of the "internal source code" of Witty and I
> > started thinking there has to be a better way.
>
> I had never thought about this use "embedded server" use-case.
>
> You were looking at the right part of the code (there are two files
> though, PosixMain and WinMain, which contain a bit of copy and paste
> code). They could be encapsulated in an embeddable 'WServer' class
> like you suggest, which is then simply used by WRun(). This WServer
> class would be public API, but only implemented for the builtin-http
> (and not for the fastcgi connector).
>
> One limitation currently is that since Wt expects only one 'server'
> per application, it uses a number of static data structures, so you
> would only be able to instantiate a single WServer class (with the
> current implementation, but that could be changed in the future with
> some reorganisation in the code).
>
> Unless you feel inclined to implement it, I will add it (to the bottom
> of) my TODO list?
>
> Regards,
> koen
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to