Class

Datagram


Description

Used to send and receive data using the UDPSocket class.

Properties

Name

Type

Read-Only

Shared

Address

String

Data

String

Port

Integer

Property descriptions


Datagram.Address

Address As String

The address of the remote machine that you are sending data to, or receiving data from.

d.Address = "192.168.1.10"

Datagram.Data

Data As String

The data you are sending or receiving.

d.Data = "Hello world"

Datagram.Port

Port As Integer

The port that the packet will be sent to when calling the Write method. If the Port property is set or left to zero, then the port that it is locally bound to is used.

When reading packets, the Port property specifies the port that the Datagram was sent from on the remote computer.

d.Port = 7080

Notes

A Datagram consists of two parts, the IP address of the remote machine which sent you the data, and the data itself. When you attempt to send data, you must specify information in the form of a Datagram. This information is usually the remote address of the machine you want to receive your packet, the port it should be sent to, and the data you wish to send the remote machine. Please see the UDPSocket for information on how to use the Datagram.

Compatibility

All project types on all supported operating systems.

See also

Object parent class; SocketCore, UDPSocket classes