Home Units Hierarchy Routines All identifiers

Class unaMulticastSocket

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaMulticastSocket = class(unaUdpSocket)

Description

interface to join on */

– unaMulticastSocket –

Hierarchy

Overview

Methods

Public function mjoin(const groupAddr: string; ioFlags: int = c_unaMC_receive or c_unaMC_send; ttl: int = IP_DEFAULT_MULTICAST_TTL; disableLoop: bool = false): int;
Public function mleave(const groupAddr: string = ''): int;
Public function sendData(data: pointer; len: int; noCheck: bool = false): int; overload;
Public function sendData(const data: aString; noCheck: bool = false): int; overload;
Public function setIF(const intf: string): int;
Public function setLoopEnable(enable: bool): int;

Properties

Public property TTL: DWORD read f_ttl write setTTL;

Description

Methods

Public function mjoin(const groupAddr: string; ioFlags: int = c_unaMC_receive or c_unaMC_send; ttl: int = IP_DEFAULT_MULTICAST_TTL; disableLoop: bool = false): int;

Joins the specified group. Also binds a socket to port and interface specified by bindToPort and bindToIP property (or default interface/port if bindToIP = '0.0.0.0'/Port = 0).

Use recvfrom() to receive multicast packets from a group(s). User sendData() to send multicast packets.

Parameters
groupAddr
multicast group address
ioFlags
any combination of c_unaMC_receive and c_unaMC_send
ttl
TTL or -1 to leave default
disableLoop
Disable local loop
Returns

0 for success, or socket-specific error code otherwise.

Public function mleave(const groupAddr: string = ''): int;

Leaves the specified group (or a group it joined in a previous successfull call to recGroupJoin() if groupAddr = '').

Parameters
groupAddr
multicast group address to leave, or '' to leave group socket is currently joined.
Returns

0 for success, or socket-specific error code otherwise.

Public function sendData(data: pointer; len: int; noCheck: bool = false): int; overload;

Sends a multicast packet into the group.

Returns

0 for success, or socket-specific error code otherwise.

Public function sendData(const data: aString; noCheck: bool = false): int; overload;

Sends a multicast packet into the group.

Returns

0 for success, or socket-specific error code otherwise.

Public function setIF(const intf: string): int;

Assigns new IF to be used with the socket. Socket must be created.

Parameters
intf
Interface to use
Returns

0 if successfull or specific WSA error otherwise.

Public function setLoopEnable(enable: bool): int;

Enables/disbale local loopback. Socket must be created.

Parameters
enable
True to enable loopback
Returns

0 if successul, WSA error otherwise

Properties

Public property TTL: DWORD read f_ttl write setTTL;

TTL

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09