README for the "changeup" interface example.
$Id: README,v 1.8 1999/08/03 01:57:28 janssen Exp $
[
 BeginILUCopyright

 Copyright (c) 1991-1999 Xerox Corporation.  All Rights Reserved.

 Unlimited use, reproduction, modification, and distribution of this
 software and modified versions thereof is permitted.  Permission is
 granted to make derivative works from this software or a modified
 version thereof.  Any copy of this software, a modified version
 thereof, or a derivative work must include both the above copyright
 notice of Xerox Corporation and this paragraph.  Any distribution of
 this software, a modified version thereof, or a derivative work must
 comply with all applicable United States export control laws.  This
 software is made available AS IS, and XEROX CORPORATION DISCLAIMS ALL
 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE, AND NOTWITHSTANDING ANY OTHER PROVISION CONTAINED HEREIN, ANY
 LIABILITY FOR DAMAGES RESULTING FROM THE SOFTWARE OR ITS USE IS
 EXPRESSLY DISCLAIMED, WHETHER ARISING IN CONTRACT, TORT (INCLUDING
 NEGLIGENCE) OR STRICT LIABILITY, EVEN IF XEROX CORPORATION IS ADVISED
 OF THE POSSIBILITY OF SUCH DAMAGES.

 EndILUCopyright ]

"changeup" is tests closing servers and connections and recovery from such things.

To build:

% ilumkmf
% make

There is one server program that exhibits three behaviors.  It periodically:
0 -	closes the idle incoming connections;
1 -	closes its port and opens a new one (not implemented yet); or
2 -	closes its server and starts a new one (same server ID).
Usage: c-server [-mt|-st] [-p <pinfo>] [-t <tinfo>] <style: {0, 1, 2}> <period: unsigned (secs)> [<iterations: unsigned>]
You want the server's period to be longer than twice the client's period.  The server and the client default to be multi-threaded iff ILU has been configured with support for OS-supplied threads.

There is one client program that exhibits 5 behaviors.  It periodically uses the server.  It has an additional behavior in which it engages either every period or only when an error occurs.  That additional behavior is one of:
0 -	calls ilu_ReLookupObject;
1 -	calls ILU_C_ValidateOrCloseObjSvr then ILU_C_LookupObject if needed; or
2 -	calls ILU_C_ShutdownObjectAndCloseServer then ILU_C_LookupObject.
Usage: c-client <always: C-bool> <destroy: {0, 1, 2}> <period: unsigned (secs)> [<iterations: unsigned>] [-mt | -st]
There are only 5 behaviors, instead of 6, because
	c-client 0 1 P
is the same as
	c-client 0 2 P
.  The client runs an infinite loop.  Except for `c-client 1 2 P`, expect to see unusual error recovery things happen at the end of a period in which a server is closed and started; messages are prefixed with times so you can check this easily.

To exercise server behavior 0:

% c-server 0 20
A's SBH is ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3616
ChgUp server, style=0, period=20
875037037 = Tue Sep 23 10:50:37 1997

875037057 FD usage = 1

875037077 FD usage = 1

875037097 FD usage = 1
...


Against that, try these client behaviors:


% c-client 0 0 7
ChgUp test, always=F, destroy=0, period=8
875037048 = Tue Sep 23 10:50:48 1997
875037049 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3616).
875037049 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3616).

875037049 At top of loop.
875037049 Iteration 0: g1=0, g2=0

875037057 At top of loop.
875037057 Iteration 1: g1=0, g2=0

875037065 At top of loop.
875037065 Iteration 2: g1=1, g2=1

875037073 At top of loop.
875037073 Iteration 3: g1=1, g2=1

875037081 At top of loop.
875037081 Iteration 4: g1=2, g2=2
...


% c-client 0 2 7
ChgUp test, always=F, destroy=2, period=7
875037164 = Tue Sep 23 10:52:44 1997
875037164 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037164 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).

875037164 At top of loop.
875037164 Iteration 0: g1=0, g2=0

875037171 At top of loop.
875037171 Iteration 1: g1=0, g2=0

875037178 At top of loop.
875037178 Iteration 2: g1=0, g2=0

875037185 At top of loop.
875037185 Iteration 3: g1=1, g2=1
...


% c-client 1 0 7
ChgUp test, always=T, destroy=0, period=7
875037198 = Tue Sep 23 10:53:18 1997

875037198 At top of loop.
875037198 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037198 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037198 Iteration 0: g1=1, g2=1

875037205 At top of loop.
875037205 Lookup 1 succeeded (chg=0, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037205 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037205 Iteration 1: g1=2, g2=2

875037212 At top of loop.
875037212 Lookup 1 succeeded (chg=0, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037212 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037212 Iteration 2: g1=2, g2=2
...


% c-client 1 1 7
ChgUp test, always=T, destroy=1, period=7
875037240 = Tue Sep 23 10:54:00 1997

875037240 At top of loop.
875037240 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037240 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037240 Iteration 0: g1=4, g2=4

875037247 At top of loop.
875037248 Iteration 1: g1=4, g2=4

875037255 At top of loop.
875037255 Iteration 2: g1=4, g2=4

875037262 At top of loop.
875037262 Iteration 3: g1=5, g2=5
...


% c-client 1 2 7
ChgUp test, always=T, destroy=2, period=7
875037287 = Tue Sep 23 10:54:47 1997

875037287 At top of loop.
875037287 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037287 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037287 Iteration 0: g1=6, g2=6

875037294 At top of loop.
875037294 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037294 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037294 Iteration 1: g1=6, g2=6

875037301 At top of loop.
875037301 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037301 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3621).
875037301 Iteration 2: g1=7, g2=7
...


To exercise server behavior 2:

% c-server 2 20
A's SBH is ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3632
ChgUp server, style=2, period=20
875037343 = Tue Sep 23 10:55:43 1997

875037363 Closing server...
A's SBH is ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3634

875037363 Server restarted

875037383 Closing server...
A's SBH is ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3637

875037383 Server restarted
...


Against that, try these client behaviors:


% c-client 0 0 7
ChgUp test, always=F, destroy=0, period=7
875037351 = Tue Sep 23 10:55:51 1997
875037351 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3632).
875037351 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3632).

875037351 At top of loop.
875037351 Iteration 0: g1=0, g2=0

875037358 At top of loop.
875037358 Iteration 1: g1=0, g2=0

875037365 At top of loop.
875037365 GetBrother(o1) => sys exn CORBA: invalid object reference, minor=8, completed=1
875037365 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3634).
875037365 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3634).

875037365 At top of loop.
875037365 Iteration 2: g1=1, g2=1

875037372 At top of loop.
875037372 Iteration 3: g1=1, g2=1
...


% c-client 0 1 7
ChgUp test, always=F, destroy=1, period=7
875037425 = Tue Sep 23 10:57:05 1997
875037425 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3641).
875037425 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3641).

875037425 At top of loop.
875037425 Iteration 0: g1=4, g2=4

875037432 At top of loop.
875037432 Iteration 1: g1=4, g2=4

875037439 At top of loop.
875037439 Iteration 2: g1=4, g2=4

875037446 At top of loop.
875037446 GetBrother(o1) => sys exn CORBA: invalid object reference, minor=8, completed=1
875037446 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3643).
875037446 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3643).

875037446 At top of loop.
875037446 Iteration 3: g1=5, g2=5

875037453 At top of loop.
875037453 Iteration 4: g1=5, g2=5
...


% c-client 1 0 7
ChgUp test, always=T, destroy=0, period=7
875037471 = Tue Sep 23 10:57:51 1997

875037471 At top of loop.
875037471 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3646).
875037471 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3646).
875037471 Iteration 0: g1=6, g2=6

875037478 At top of loop.
875037478 Lookup 1 succeeded (chg=0, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3646).
875037478 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3646).
875037479 Iteration 1: g1=6, g2=6

875037486 At top of loop.
875037486 Lookup 1 failed.
875037487 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3648).
875037487 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3648).
875037487 Iteration 2: g1=7, g2=7

875037494 At top of loop.
875037494 Lookup 1 succeeded (chg=0, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3648).
875037494 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3648).
875037494 Iteration 3: g1=7, g2=7
...


% c-client 1 1 7
ChgUp test, always=T, destroy=1, period=7
875037522 = Tue Sep 23 10:58:42 1997

875037522 At top of loop.
875037522 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3651).
875037522 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3651).
875037522 Iteration 0: g1=8, g2=8

875037530 At top of loop.
875037530 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3653).
875037530 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3653).
875037530 Iteration 1: g1=9, g2=9

875037537 At top of loop.
875037537 Iteration 2: g1=9, g2=9
...


% c-client 1 2 7
ChgUp test, always=T, destroy=2, period=7
875037565 = Tue Sep 23 10:59:25 1997

875037565 At top of loop.
875037565 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3657).
875037566 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3657).
875037566 Iteration 0: g1=11, g2=11

875037573 At top of loop.
875037573 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3657).
875037573 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3657).
875037573 Iteration 1: g1=11, g2=11

875037580 At top of loop.
875037580 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3657).
875037580 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3657).
875037580 Iteration 2: g1=11, g2=11

875037587 At top of loop.
875037587 Lookup 1 succeeded (chg=1, sbh=ilu:ChgUp-Server/A;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3661).
875037587 Lookup 2 succeeded (chg=0, sbh=ilu:ChgUp-Server/B;ilu%3AfamFzTLwIRhdoUYbusGWlqc0mhL;sunrpc@sunrpcrm=tcp_13.2.116.14_3661).
875037587 Iteration 3: g1=12, g2=12
