[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [dev-serveez] progress to serveez-0.2
From: |
Julian Graham |
Subject: |
Re: [dev-serveez] progress to serveez-0.2 |
Date: |
Sat, 10 Nov 2012 18:17:54 -0500 |
On Mon, Nov 5, 2012 at 3:21 AM, Thien-Thi Nguyen <address@hidden> 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 = 0;
Is there a less hacky way of disabling that functionality?
> * svz_server_finalize_all
> * svz_server_init_all
>
> These have been combined into ‘svz_updn_all_servers’. See (static func)
> ‘guile_entry’ 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, ‘svz_portcfg_prepare’ is now called by
> ‘svz_server_bind’, which is part of the API, and furthermore exposed to
> Scheme as part of procedure ‘bind-server!’. See test/t00[1234] for good
> 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 = svz_server_get ("myserver");
svz_updn_all_servers (1);
svz_server_bind (myserver, myportcfg);
Thanks for your help!