TIdRawBase
Ancestor class for Raw
socket clients.
Unit
Description
The TIdRawBase is an ancestor of components which use raw sockets. This allows the programmer to code for protocols that are not supported by the standard stack (ICMP, IGMP or any custom protocol).
Depending on the underlying operating system and on the security privilege of the user, it might also allow the programmer to build the IP header (currently, this is only supported by Windows 2000). http://www.microsoft.com/windows95/downloads/contents/wuadmintools/s_wunetworkingtools/w95sockets2/default.asp . For Windows98, no updates are required because that included Winsock 2. For WindowsNT, you need administrative rights and Service Pack 3. -->
Represents the
socket handle for the connection.
Description
Binding is a read-only
TIdSocketHandle property that represents the
socket handle binding for the connection. When accessed, Binding.AllocateSocket is called to insure that the connection uses raw sockets for the
Protocol selected. In addition,
socket options for the Binding are updated to use
Id_IPPROTO_IP protocol family with the specified
TTL (Time-To-Live).
Size of the internal Indy buffer.
property BufferSize: Integer;
Description
BufferSize is an Integer property that indicates the size of the internal Indy buffer for the
socket connection. Changing the value of BufferSize force the Indy buffer to be enlarged or contracted to the specified number of bytes.
The default value for BufferSize is Id_TIdRawBase_BufferSize.
Specifies the endpoint for the
socket connection.
Description
Host is a String property that specifies the IP address or host name that is the endpoint for the
socket connection.
Use Port to indicate the port number used for the socket connection.
Identifies the port number for the endpoint of the
socket connection.
Description
Port is an Integer property that identifies the port number for the endpoint of the
socket connection.
Use host to specify the IP address or host name for the connection.
Identifies the protocol option for the
socket connection.
property Protocol: Integer;
Description
Protocol is an Integer property that identifies the protocol used for the
socket connection. The default value for Protocol is
Id_IPPROTO_RAW, as established in
Create.
Binding.AllocateSocket uses the Protocol property to bind both the protocol family and protocol options for the socket handle.
Identifies the timeout for receive operations.
property ReceiveTimeout: integer;
Description
ReceiveTimeout is an Integer property that indicate the number of milliseconds that receive operations must wait for the
socket to become readable.
The default value for ReceiveTimeout is GFReceiveTimeout, as established in Create. When ReceiveTimeout is 0, no timeout will occur while waiting for the socket to become readable.
Specifies the Time-To-Live for raw
socket packets.
Description
TTL is an Integer property that identifies the Time-To-Live for routers and gateways that must handle the raw
socket transmission. TTL is used to set the
socket options for the
Binding. Changing the value of TTL forces an update to the
socket options for
Binding.
The default value of TTL is GFTTL.
Constructor for the object instance.
constructor Create(AOwner: TComponent); override;
Parameters
AOwner: TComponent
Owner of the object instance.
Description
Create is the constructor for the object instance. Create initializes object properties to their default values, including:
Frees the object instance.
destructor Destroy; override;
Description
Destroy is the destructor for the object instance. Destroy clears, frees, and releases the
Binding for the
socket connection and the internal Indy read buffer.
Reads and buffers data from the
socket connection.
function ReceiveBuffer(var ABuffer; const AByteCount: Integer; ATimeOut: integer = -1): integer;
Parameters
var ABuffer
Buffer for data read from the connection.
const AByteCount: Integer
Number of bytes to read in to the buffer.
ATimeOut: integer = -1
Timeout value. Default value is -1.
Return Value
Integer - Number of bytes read from the connection.
Description
ReceiveBuffer is an Integer function used to receive and store data arriving on the
socket connection.
ABuffer is the destination for data read from the connection. AByteCount indicates the number of bytes anticipated to be read from the socket connection. ATimeOut is the number of milliseconds to wait for the Binding to become readable.
When ATimeOut is less than 0, the value in ReceiveTimeout is used.
If the specified timeout period elapses, AByteCount is less than 1, or ABuffer is nil, then the return value for ReceiveBuffer is 0.
Transmits data to remote computer system.
procedure Send(AData: string); overload;
procedure Send(AHost: string; const APort: Integer; AData: string); overload;
procedure Send(AHost: string; const APort: integer; var ABuffer; const ABufferSize: integer); overload;
Parameters
AData: string
Value to be sent over the connection.
AHost: string
Destination address for the
send operation.
const APort: Integer
Destination port number for the
send operation.
var ABuffer
Buffer containing values to be sent over the connection.
const ABufferSize: integer
Size of the buffer to be sent.
Description
Send is an overloaded procedure that allows the connection to transmit the specified data or buffer to the address identified in AHost and APort.
When the Send(AData) variant is called, the values from Host and Port are used for the destination.
Send resolves the address in AHost prior to transmitting data.
Transmits data to remote computer system.
procedure Send(AData: string); overload;
procedure Send(AHost: string; const APort: Integer; AData: string); overload;
procedure Send(AHost: string; const APort: integer; var ABuffer; const ABufferSize: integer); overload;
Parameters
AData: string
Value to be sent over the connection.
AHost: string
Destination address for the
send operation.
const APort: Integer
Destination port number for the
send operation.
var ABuffer
Buffer containing values to be sent over the connection.
const ABufferSize: integer
Size of the buffer to be sent.
Description
Send is an overloaded procedure that allows the connection to transmit the specified data or buffer to the address identified in AHost and APort.
When the Send(AData) variant is called, the values from Host and Port are used for the destination.
Send resolves the address in AHost prior to transmitting data.
Transmits data to remote computer system.
procedure Send(AData: string); overload;
procedure Send(AHost: string; const APort: Integer; AData: string); overload;
procedure Send(AHost: string; const APort: integer; var ABuffer; const ABufferSize: integer); overload;
Parameters
AData: string
Value to be sent over the connection.
AHost: string
Destination address for the
send operation.
const APort: Integer
Destination port number for the
send operation.
var ABuffer
Buffer containing values to be sent over the connection.
const ABufferSize: integer
Size of the buffer to be sent.
Description
Send is an overloaded procedure that allows the connection to transmit the specified data or buffer to the address identified in AHost and APort.
When the Send(AData) variant is called, the values from Host and Port are used for the destination.
Send resolves the address in AHost prior to transmitting data.