Re: progress to serveez-0.2

Julian Graham <[email protected]> Sat, 10 Nov 2012 18:17:54 -0500
Newsgroups gmane.network.serveez.devel
Message-ID <CANdC_RBdeNPzJXxzsGVCLBdSQBri8QW0iKzw2bKWSK+OZ6vypw@mail.gmail.com>
On Mon, Nov 5, 2012 at 3:21 AM, Thien-Thi Nguyen <[email protected]> wrote:
>    * svz_coserver_types
>
> I can't find this symbol anywhere in the repo (past or present).  What
> is its role in your program?  Which Serveez version are you digging
> around in?

Sorry, that should be "svz_coservertypes." Now that I'm sifting
through my own code again, the threads are coming back to me: I was
trying to come up with a way to prevent the four-or-so coserver child
processes from starting up, since the program I was linking with
libserveez didn't need them and they were complicating some process
control I was trying to do. So I had a block of code that looked like:

  for (; i < MAX_COSERVER_TYPES; i++)
    svz_coservertypes[i].instances =3D 0;

Is there a less hacky way of disabling that functionality?


>    * svz_server_finalize_all
>    * svz_server_init_all
>
> These have been combined into =91svz_updn_all_servers=92.  See (static fu=
nc)
> =91guile_entry=92 in src/serveez.c for details.  But see below first.

Okay, I've updated my code to use `svz_updn_all_servers'.


>    * svz_portcfg_prepare
>    * svz_server_instantiate
>    * svz_server_create
>    * svz_server_add
>
> These have been "internalized".  I think the blessed way now is to avoid
> this sort of imperative plumbing and specify things in Scheme, and/or at
> a higher level.  For instance, =91svz_portcfg_prepare=92 is now called by
> =91svz_server_bind=92, which is part of the API, and furthermore exposed =
to
> Scheme as part of procedure =91bind-server!=92.  See test/t00[1234] for g=
ood
> examples, test/t006 for bad (i.e., PEBKAC situation).

Okay. I think I've found alternate invocations that achieve the same
result as the functions I was using. I appreciate that this stuff is
exposed via Guile -- and my application /does/ use Guile quite heavily
-- but for reasons of code organization, I'd like to set up my server
sockets in C, not Scheme. Can you tell me if the following looks like
a reasonable use of libserveez's API? (It seems to work, FWIW.)

  svz_servertype_add (&myservertype);
  svz_config_type_instantiate ("server", "myservertype", "myserver",
NULL, NULL, 0, NULL);
  my_server =3D svz_server_get ("myserver");
  svz_updn_all_servers (1);
  svz_server_bind (myserver, myportcfg);

Thanks for your help!