O'Reilly logo

Network Programming for Microsoft® Windows®, Second Edition by Jim Ohlund, Anthony Jones

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

UDP Example

Let’s examine a sample UDP application. Look at the sample Visual Basic project SOCKUDP.VBP in the Chapter 14 samples directory on the CD. When the project is compiled and run, you will see a dialog similar to the one illustrated in Figure 14-1.

This sample application both sends and receives UDP messages, so you can use just one instance to send and receive messages. In addition, all the code behind the form, buttons, and Winsock controls is given in the following sample:

Figure 14-1. Sample UDP application

 Option Explicit Private Sub cmdExit_Click()     Unload Me End Sub   Private Sub cmdSendDgram_Click()     ' If the socket state is closed, we need to bind to a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required