HomeForumSourceResearchGuide
Sign in to contribute to source. how it works
Type definition file net.UDPServer by barry
expand copy to clipboardexpand
/* {"description" : "This data type represents a datagram (a discrete packet of data transmitted over UDP)."} */
data Datagram{
	/* {"@description" : "The remote host address from which this datagram was sent)."} */
	char address[]
	/* {"@description" : "The remote host port number from which this datagram was sent)."} */
	int port
	/* {"@description" : "The content of the datagram)."} */
	byte content[]
	}

/*
{"description" : "Bind a UDP server socket to receive UDP packets."}
*/

interface UDPServer{
	/* {"@description" : "Bind to any and all IP addresses of the host."} */
	const char ANY_ADDRESS[] = "ANY"
	
	/* {"@description" : "Bind to any and all IPv4 addresses of the host."} */
	const char ANY_ADDRESS_v4[] = "ANY_v4"
	
	/* {"@description" : "Bind to any and all IPv6 addresses of the host."} */
	const char ANY_ADDRESS_v6[] = "ANY_v6"
	
	/* {"@description" : "Bind a UDP server socket to a given IP address and port number."} */
	bool bind(char address[], int port)
	
	/* {"@description" : "Unbind this socket (allowing other sockets to bind to this address/port)."} */
	void unbind()
	
	/* {"@description" : "Receive a UDP packet (blocks until a packet is received)."} */
	Datagram recv()

	/* {"@description" : "Switch this UDP server to non-blocking mode, for use in combination with UDPMonitor."} */
	bool setNonBlocking()
	}
Revision history
To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n net.UDPServer -m "reason for update" -u yourUsername
Version 2 (this version) by barry
Notes for this version: Updates documentation strings.
Version 1 by barry