[Oberon] AosTCP.Mod

Thomas Frey thomas.frey at alumni.ethz.ch
Sun Apr 16 18:50:18 CEST 2006


The table ARRAY contains the heads of linked lists of Connection.
Inside the WHILE loop, the first Connection of the hash table at
position i is finalized. The finalization automatically (via Finalize
--> Discard --> Drop / CloseConnection) removes the Connection form
the linked list, and the next Connection in the list moves to the
list-head ( table[i]).
So the WHILE table[i] # NIL "destructively" traverses the list.

--Thomas

On 4/16/06, Stefan Salewski <mail at ssalewski.de> wrote:
> MODULE AosTCP; (** AUTHOR "pjm, mvt"; PURPOSE "TCP protocol"; *)
>
> (* Finalize all connections in this pool *)
> PROCEDURE Finalize();
> VAR i: LONGINT;
> BEGIN
>         FOR i:= 0 TO HashTableSize-1 DO
>                 WHILE table[i] # NIL DO
>                         table[i].Finalize();
>                 END;
>         END;
> END Finalize;
>
> Can someone give me a hint about the purpose
> of this WHILE-loop?
> For me this construct looks strange.
>
> Best regards
>
> Stefan Salewski
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>


More information about the Oberon mailing list