C# .NET Web Developer's Guide

Creating a News Ticker Using UDP Multicasting

A news ticker is an application where a news server sends messages to a number of clients. A client subscribes to the news server. From the moment of subscription, the client is allowed to receive new messages from the server.

You can implement implement such an architecture in several ways, but the easiest is using UDP multicasting. As described in the section Introduction to UDP, with UDP, you can group applications (peers) together. An IP address together with a port is the alias for the group; that means a peer sends data to that IP address and port and all peers of that group will receive the data.

In this section, you will see how to develop a simple news ticker server and client. The server is a simple Windows Forms application with a text box and a button. The user types in the news in the text box. By clicking on the button, the server sends the news to the group (see Figure 5.40). The server must send news continuously so that a client can be started at any time for receiving the news.


Figure 5.40: UDP Multicast News Server

The client also is a simple Windows Forms application with only one text box. If news arrives, it will be displayed in the text box by shifting the text from the right to the left like a marquee (see Figure 5.41).


Figure 5.41: UDP Multicast News Client

General Usage of...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: News Sites
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.