<h4>How Do I...Make a chat client with UDPClient?</h4>
<div class="indent" style="width:660"></div>
<P>This sample illustrates using the UDPClient class to create a chat client.</P>
<P>
This sample is a complete and fully functional chat client. It uses UDP to send and receive chat messages with other users that are also using the client. The program illustrates many important NGWS concepts, but the most important (for this How To) is the use of the <B>UDPClient</B> class.
</P>
<P>
THe UDPCLient object is initialized with a constructor call that sets the port the object will listen on. Then the object joins a Multicast group. This code can be found in the Initialize function of the sample code.
</P>
<P>
Once initialized, the UDPClient listens for incoming messages with the <B>Receive</B> function, which can be found in the Listener function of the sample code. The Receive function returns an array of bytes, containing the data sent. This data can be converted into a String with the ASCII object GetString function.
</P>
<P>
Sending data is just as easy. The UDPClient includes a function called <B>Send</B> which sends out a byte array to every class that is listening on the Multicast group.