[Oberon] NetSystem.Available and NetSystem.State.

peter at easthope.ca peter at easthope.ca
Mon Nov 6 16:19:57 CET 2023


Hi,

Oberon NetSystem is visible here.
https://gitlab.inf.ethz.ch/felixf/oberon/-/blob/main/source/Unix.Oberon.NetSystem.Mod

Eight constants are declared for the return values of State.  According to the 
response from TCP, State can return four of those values.  State is unable to 
return in, out, waitCon and errorCon.

I wonder about use of the return values not included in State.

NetTools.Connected is a pertinent example.

(** Check if connection C is still open for incoming (mode = NetSystem.in) or outgoing (mode = NetSystem.out) data. *)
	PROCEDURE Connected*(C: NetSystem.Connection; mode: SIGNED16): BOOLEAN;
		VAR state: SIGNED16;
	BEGIN
		state := NetSystem.State(C);
		RETURN state IN {mode, NetSystem.inout}
	END Connected;

The local state will never be assigned NetSystem.in or NetSystem.out.  
Therefore "RETURN state IN {mode, NetSystem.inout}" simplifies to 
"RETURN state = NetSystem.inout".  Correct?

Did the author of NetSystem include in, out, waitCon and errorCon to 
allow for a future generalization?  Other ideas?

Thanks,                               ... P.L.

- 
VoIP:   +1 604 670 0140
work: https://en.wikibooks.org/wiki/User:PeterEasthope



More information about the Oberon mailing list