Home Units Hierarchy Routines All identifiers

Class unavclIPClient

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unavclIPClient = class(unavclInOutIpPipe)

Description

IP Client: connects to remote server, sends and receives audio stream over TCP/IP network.

Usage: set host, proto and port properties to specify the remote host. Set active to true or call the open() method to initiate the connection.

Example: refer to vcTalkNow demo, with ip_client it is possible to send compressed audio stream over network and receive audio stream from remote server for playback.

Hierarchy

Overview

Methods

Protected function doSendPacket(connId: tConID; cmd: uint; out asynch: bool; data: pointer = nil; len: uint = 0; timeout: tTimeout = 81): tunaSendResult; override;
Protected function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; override;
Protected function handleSocketEvent(event: unaSocketEvent; id, connId: tConID; data: pointer; len: uint): bool; override;
Protected function initSocksThread(): tConID; override;
Protected function isActive(): bool; override;
Protected function onNewPacket(cmd: uint; data: pointer; len: uint; connId: tConID; worker: uint): bool; override;
Public procedure AfterConstruction(); override;
Public procedure BeforeDestruction(); override;
Protected procedure sendGoodbye(connId: tConID); override;

Properties

Published property bindToPort;
Public property clientConnId: tConID read f_connId;
Published property host;
Public property isConnected: bool read f_isConnected;
Published property onClientConnect: tunavclConnectEvent read f_onClientConnect write f_onClientConnect;
Published property onClientDisconnect: tunavclConnectEvent read f_onClientDisconnect write f_onClientDisconnect;
Published property pingInterval: uint32 read f_pingInterval write f_pingInterval default 0;

Description

Methods

Protected function doSendPacket(connId: tConID; cmd: uint; out asynch: bool; data: pointer = nil; len: uint = 0; timeout: tTimeout = 81): tunaSendResult; override;

Sends a packet to server.

Protected function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; override;

Writes data into the TCP/IP stream to be sent to server.

Protected function handleSocketEvent(event: unaSocketEvent; id, connId: tConID; data: pointer; len: uint): bool; override;
 
Protected function initSocksThread(): tConID; override;
 
Protected function isActive(): bool; override;

Returns active state of IP Client.

Protected function onNewPacket(cmd: uint; data: pointer; len: uint; connId: tConID; worker: uint): bool; override;
 
Public procedure AfterConstruction(); override;
 
Public procedure BeforeDestruction(); override;
 
Protected procedure sendGoodbye(connId: tConID); override;

Sends goodbye packet to the server.

Properties

Published property bindToPort;

Local port number client should bind to. 0 means client will let system to select any free port.

Public property clientConnId: tConID read f_connId;

Client socket connection Id.

Published property host;

Remote host DNS name/IP address to connect to.

Public property isConnected: bool read f_isConnected;

Returns true if client socket is connected to remote host

Published property onClientConnect: tunavclConnectEvent read f_onClientConnect write f_onClientConnect;

Triggers when client has been connected to the server.

NOTE: VCL is NOT multi-threading safe, and you should avoid using VCL routines and classes in this event.

Published property onClientDisconnect: tunavclConnectEvent read f_onClientDisconnect write f_onClientDisconnect;

Triggers when client has been disconnected from the server.

NOTE: VCL is NOT multi-threading safe, and you should avoid using VCL routines and classes in this event.

Published property pingInterval: uint32 read f_pingInterval write f_pingInterval default 0;

Specifies the inteval in milliseconds the client should send a dummy "ping" packet to the server. Use this with UDP client only which do not send data to server, so server will not disconnect the client due to timeout. Default value is 0, means ping is disabled.

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09