AGK for Pascal
TAgkBroadcastListener.Create Constructor

Creates a broadcast listener.

constructor Create(const Owner: TAgkObject; const Port: Integer);
const Owner: TAgkObject 
the owner of the broadcast listener (eg. a TAgkApplication object). 
const Port: Integer 
The port that the messages are being broadcast on, in the case of AGK networks this will be port 45631. 

Broadcasts are special network communications as they do not use a destination address and are instead received by all devices on a network. Broadcast packets are not forwarded by routers so can only be used on the local area network, or more specifically the local subnet. This can be useful for discovering devices as one device can send a broadcast packet containing its IP address and another device can pick it up, read the IP and connect back to the first device to create a two-way connection. 

AGK networks are broadcast in this manner on port 45631 and send a packet containing the name of a network that has been hosted by another AGK device. By using a broadcast listener you can pick these messages up, extract the network names and display them to the user for them to choose which network they want to connect to. 


Copyright (c) 2012. All rights reserved.