HomeForumSourceResearchGuide
Sign in to contribute to source. how it works
Type definition file net.UDPMonitor by barry
expand copy to clipboardexpand
uses UDPServer

/* {"description" : "MonitorEvent instances are returned by a UDPMonitor when activity occurs over any of the monitored sockets."} */
data MonitorEvent {
	/* {"@description" : "The socket to which this event relates."} */
	UDPServer socket
	/* {"@description" : "The userData (if any) that was associated with this socket in the UDPMonitor."} */
	Data userData
	/* {"@description" : "The socket is ready to receive some bytes."} */
	bool recvReady
}

/*
{"description" : "Monitor activity over multiple non-blocking sockets."}
*/

interface UDPMonitor {
	
	/* {"@description" : "Create a new monitor instance."} */
	UDPMonitor()
	
	/* {"@description" : "Add a socket to this monitor instance, optionally associating a data instance with it. The monitor will deliver recv and close events by default, indicating that the socket has data available for receive or that it has been closed."} */
	bool addSocket(store UDPServer s, opt store Data userData)

	/* {"@description" : "Remove a socket from this monitor instance."} */
	void remSocket(UDPServer s)
	
	/* {"@description" : "Wait for activity on any of the sockets in this monitor instance."} */
	MonitorEvent[] wait(opt int ms)
	
	}
Revision history
To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n net.UDPMonitor -m "reason for update" -u yourUsername
Version 2 (this version) by barry
Notes for this version: Updates documentation strings.
Version 1 by barry