Version: 2.10.2.1
TCP, UDP, Daemon, DNS, Ping and RAS controls for Internet application development.

Udp ActiveX Control

Use the Udp control to easily send and receive User, Multicast, and raw IP Datagrams. Features include:

  • Supports raw datagrams, providing the ability to access advanced protocols like ICMP.
  • Supports multicast datagrams, allowing you to send and receive streaming protocols, and to easily construct chat programs.
  • Broadcast operation.

 

Looking for the .NET version of this control?

Development Environments

  • Visual Studio .NET (.NET Framework)
  • Visual Basic (VB)
  • Visual C++ (VC++)
  • FoxPro
  • PowerBuilder
  • Delphi
  • C++ Builder
  • ASP
  • Office 97/2000

Interface

 

Public Properties
Blocked A True value indicates the control is currently executing a blocking method (Timeout is greater than 0), which has neither completed nor timed out with a ptTimeout error.
DontEcho Disables the local echoing of multicast packets sent by the control.
LocalAddress Returns the address in use while the socket is active and an empty string when the UDP socket is closed.
LocalPort Returns the port number in use while the socket is active and 0 when the socket is closed. When the Protocol property of the UDP Control is not ptUdp, LocalPort returns 0.
MaxSubnets Maximum number of subnets a multicast packet is allowed to travel.
Protocol The datagram protocol to use.
SendDatagramCount Number of datagrams queued for sending.
Timeout Controls the blocking behavior of methods that can be used in blocking and non-blocking ways.
UserHeaders Enables the use of user-defined IP headers.
Public Methods
Abort Abort any blocking method and release all system resources.
About Show the About Box.
Close Release system resources.
Join Join a multicast group.
Leave Leave a multicast group.
Open Allocate a socket for sending and receiving datagrams.
Receive Receive a datagram into a buffer.
Send Send a datagram to the specified remote address and port.
Trace Start or stop the accumulation of trace or debug data. Once started, this method accumulates data until it is turned off.
Public Events
Error Fires when an error condition occurs.
Receive Fires when a datagram is available for receiving.
Send Fires when the system accepts a datagram for transmission.

Code Example

How easy is the UDP control to use? Check out the following UDP VB example below, which demonstrates sending a datagram and receiving a response.

Dim uResponse As String
Dim uAddress As String
Dim uPort As String

Udp1.Timeout = 0

'LocalPort defaults to 0... system will assign an unused (ephemeral) port
Udp1.Open

' Send a datagram to www.dart.com, echo port 7
Udp1.Send "Send me an echo", "www.dart.com", 7

' uResponse will by dynamically expanded and filled with the echo response
Udp1.Receive uResponse
uAddress = Udp1.LocalAddress
uPort = Udp1.LocalPort

'display address and port information in message box
dMsg = d & vbCrLf
dMsg = dMsg & "LocalAddress is " & uAddress & vbCrLf
dMsg = dMsg & "LocalPort is " & uPort
MsgBox dMsg