Class TUDPBlockSocket

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TUDPBlockSocket = class(TDgramBlockSocket)

Description

Implementation of UDP socket.

NOTE: in this class is all receiving redirected to RecvBufferFrom. You can use for reading any receive function. Preffered is RecvPacket! Similary all sending is redirected to SendbufferTo. You can use for sending UDP packet any sending function, like SendString.

Supported features: IPv4, IPv6, unicasts, broadcasts, multicasts, SOCKS5 proxy (only unicasts! Outgoing and incomming.)

Hierarchy

Overview

Methods

Public destructor Destroy; override;
Public procedure EnableBroadcast(Value: Boolean);
Public function SendBufferTo(Buffer: TMemory; Length: Integer): Integer; override;
Public function RecvBufferFrom(Buffer: TMemory; Length: Integer): Integer; override;
Public procedure AddMulticast(MCastIP:string);
Public procedure DropMulticast(MCastIP:string);
Public procedure EnableMulticastLoop(Value: Boolean);
Public function GetSocketType: integer; override;
Public function GetSocketProtocol: integer; override;

Properties

Public property MulticastTTL: Integer read GetMulticastTTL Write SetMulticastTTL;

Description

Methods

Public destructor Destroy; override;
 
Public procedure EnableBroadcast(Value: Boolean);

Enable or disable sending of broadcasts. If seting OK, result is True. This method is not supported in SOCKS5 mode! IPv6 does not support broadcasts! In this case you must use Multicasts instead.

Public function SendBufferTo(Buffer: TMemory; Length: Integer): Integer; override;

See TBlockSocket.SendBufferTo

Public function RecvBufferFrom(Buffer: TMemory; Length: Integer): Integer; override;

See TBlockSocket.RecvBufferFrom

Public procedure AddMulticast(MCastIP:string);

Add this socket to given multicast group. You cannot use Multicasts in SOCKS mode!

Public procedure DropMulticast(MCastIP:string);

Remove this socket from given multicast group.

Public procedure EnableMulticastLoop(Value: Boolean);

All sended multicast datagrams is loopbacked to your interface too. (you can read your sended datas.) You can disable this feature by this function. This function not working on some Windows systems!

Public function GetSocketType: integer; override;

Return value of socket type. For UDP return SOCK_DGRAM.

Public function GetSocketProtocol: integer; override;

Return value of protocol type for socket creation. For UDP return IPPROTO_UDP.

Properties

Public property MulticastTTL: Integer read GetMulticastTTL Write SetMulticastTTL;

Set Time-to-live value for multicasts packets. It define number of routers for transfer of datas. If you set this to 1 (dafault system value), then multicasts packet goes only to you local network. If you need transport multicast packet to worldwide, then increase this value, but be carefull, lot of routers on internet does not transport multicasts packets!


Generated by PasDoc 0.9.0 on 2012-04-23 21:38:50