receiverhandle.dcl 1.24 KB
Newer Older
Peter Achten's avatar
Peter Achten committed
1
2
3
4
5
6
7
definition module receiverhandle


//	Clean Object I/O library, version 1.2


import	id, receivermessage
8
from	ostoolbox	import OSToolbox // MW11++
Peter Achten's avatar
Peter Achten committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25


::	ReceiverHandles pst
	=	{	rReceivers	:: [ReceiverStateHandle pst]
		}
::	ReceiverStateHandle pst
	=	E. .ls:
		{	rState		:: ls							// If has local state then [_], otherwise []
		,	rHandle		:: ReceiverHandle ls pst		// The receiver handle
		}
::	ReceiverHandle ls pst
	=	E. m r:
		{	rId			:: Id							// The id of the receiver
		,	rASMQ		:: [m]							// The asynchronous message queue
		,	rSelect		:: SelectState					// The attribute ReceiverSelect==Able (default True)
		,	rOneWay		:: Bool							// The receiver definition was Receiver (not Receiver2)
		,	rFun		:: RHandleFunction ls m r pst	// If rOneWay then [r]==[], otherwise [r]==[_]
26
27
28
29
30
// MW11..
		,	rInetInfo	:: !Maybe (!EndpointRef`,!InetReceiverCategory`,!Int,!IdFun !*OSToolbox)
														// For internet receivers
		,	rConnected	:: ![Id]						// storing the argument of the ReceiverCloseAlsoReceivers attribute
// ..MW11
Peter Achten's avatar
Peter Achten committed
31
32
		}
::	RHandleFunction ls m r pst
33
	:==	m -> *(ls,pst) -> *(ls,[r],pst)
Peter Achten's avatar
Peter Achten committed
34

35
36
37
38
39
40
41
// MW11..
::	InetReceiverASMQType	:== (!InetEvent`,!EndpointRef`,!Int)

::	InetEvent`				:== Int
::	EndpointRef`			:==	Int
::	InetReceiverCategory`	:==	Int
// ..MW11