# Class TUDPBlockSocket

Description | Hierarchy | Fields | Methods | Properties

## Unit

blcksock

## 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

- TObject
- TBlockSocket
- TSocksBlockSocket
- TDgramBlockSocket
- TUDPBlockSocket

## Overview

### Methods

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

### Properties

| `property MulticastTTL: Integer read GetMulticastTTL Write SetMulticastTTL;`

## Description

### Methods

| `destructor Destroy; override;`

| `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.

| `function SendBufferTo(Buffer: TMemory; Length: Integer): Integer; override;`

See TBlockSocket.SendBufferTo

| `function RecvBufferFrom(Buffer: TMemory; Length: Integer): Integer; override;`

See TBlockSocket.RecvBufferFrom

| `procedure AddMulticast(MCastIP:string);`

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

| `procedure DropMulticast(MCastIP:string);`

Remove this socket from given multicast group.

| `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!

| `function GetSocketType: integer; override;`

Return value of socket type. For UDP return SOCK_DGRAM.

| `function GetSocketProtocol: integer; override;`

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

### Properties

| `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