Home Units Hierarchy Routines All identifiers

Class unavclInOutIpPipe

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unavclInOutIpPipe = class(unavclInOutPipe)

Description

Base abstract class for TCP/IP stream pipes.

Hierarchy

Overview

Methods

Public function getErrorCode(): int;
Public function getHostAddr(connId: tConID = $FFFFFFFF): pSockAddrIn;
Public function getHostInfo(out ip, port: string; connId: tConID = $FFFFFFFF): bool; overload;
Public function sendData(connId: tConID; data: pointer; len: uint): tunaSendResult;
Public function sendPacket(connId: tConID; cmd: uint; data: pointer = nil; len: uint = 0; timeout: tTimeout = 80): tunaSendResult;
Public function sendText(connId: tConID; const data: aString): tunaSendResult;
Protected function applyFormat(data: pointer; len: uint; provider: unavclInOutPipe = nil; restoreActiveState: bool = false): bool; override;
Protected function doOpen(): bool; override;
Protected function doRead(data: pointer; len: uint): uint; override;
Protected function doSendPacket(connId: tConID; cmd: uint; out asynch: bool; data: pointer = nil; len: uint = 0; timeout: tTimeout = 79): tunaSendResult; virtual; abstract;
Protected function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; override;
Protected function getAvailableDataLen(index: integer): uint; override;
Protected function getFormatExchangeData(out data: pointer): uint; override;
Protected function handleSocketEvent(event: unaSocketEvent; id, connId: tConID; data: pointer; len: uint): bool; virtual;
Protected function initSocksThread(): tConID; virtual; abstract;
Protected function isActive(): bool; override;
Protected function onNewPacket(cmd: uint; data: pointer; len: uint; connId: tConID; worker: uint): bool; virtual;
Protected function onNewPacketData(dataType: int; data: pointer; len: uint): bool; virtual;
Protected function sendPacketToSocket(connId: tConID; seqNum, cmd: uint; out asynch: bool; data: pointer = nil; len: uint = 0; timeout: tTimeout = 78): tunaSendResult;
Public procedure AfterConstruction(); override;
Public procedure BeforeDestruction(); override;
Protected procedure doClose(); override;
Protected procedure doOnSocketEvent(sender: tObject; event: unaSocketEvent; id, connId: tConID; data: pointer; len: uint); virtual;
Protected procedure onPacketsLost(connId: tConID; lostCount: int; worker: uint); virtual;
Protected procedure sendFormat(connId: tConID);
Protected procedure sendGoodbye(connId: tConID); virtual; abstract;

Properties

Published property bindTo: string read f_bindToIP write f_bindToIP;
Protected property bindToPort: string read f_bindToPort write f_bindToPort;
Public property bytesReceived: int64 read f_bytesReceived;
Public property bytesSent: int64 read f_bytesSent;
Protected property host: string read f_host write f_host;
Public property inPacketsCount: int64 read f_inPacketsCount;
Public property inPacketsCrcErrors: unsigned read f_crcErrors;
Public property inPacketsDupCount: unsigned read f_dupCount;
Public property inPacketsOutOfSeq: unsigned read f_outOfSeq;
Published property isFormatProvider;
Public property localFormat: pointer read f_localFormat;
Published property onDataAvailable;
Published property onDataSent: tunavclUserDataEvent read f_onDataSent write f_onDataSent;
Published property onFormatChangeAfter;
Published property onFormatChangeBefore;
Published property onPacketEvent: tunavclPacketEvent read f_onPacketEvent write f_onPacketEvent;
Published property onSocketEvent: tunavclSocketEvent read f_onSocketEvent write f_onSocketEvent;
Published property onTextData: tunavclTextDataEvent read f_onTextData write f_onTextData;
Published property onUserData: tunavclUserDataEvent read f_onUserData write f_onUserData;
Public property outPacketsCount: int64 read f_outPacketsCount;
Published property port: string read f_port write f_port;
Published property proto: tunavclProtoType read f_proto write f_proto default unapt_UDP;
Public property remoteFormat: pointer read f_remoteFormat;
Public property socks: unaSocks read f_socks;
Public property socksId: tConID read f_socksId;
Published property streamByteOrderInput: tunavclStreamByteOrder read f_inStreamByteOrder write f_inStreamByteOrder default unasbo_dontCare;
Published property streamByteOrderOutput: tunavclStreamByteOrder read f_outStreamByteOrder write f_outStreamByteOrder default unasbo_dontCare;
Published property streamingMode: tunavclStreamingMode read f_streamingMode write f_streamingMode default unasm_VC;

Description

Methods

Public function getErrorCode(): int;
 
Public function getHostAddr(connId: tConID = $FFFFFFFF): pSockAddrIn;

Returns client connection object. NOTE! Connection's release() method must be called when connection object is no longer needed.

Public function getHostInfo(out ip, port: string; connId: tConID = $FFFFFFFF): bool; overload;
 
Public function sendData(connId: tConID; data: pointer; len: uint): tunaSendResult;

Sends user data into the IP stream.

Public function sendPacket(connId: tConID; cmd: uint; data: pointer = nil; len: uint = 0; timeout: tTimeout = 80): tunaSendResult;

Sends a packet into the IP stream.

Public function sendText(connId: tConID; const data: aString): tunaSendResult;

Sends a text into the IP stream.

Protected function applyFormat(data: pointer; len: uint; provider: unavclInOutPipe = nil; restoreActiveState: bool = false): bool; override;

Since IP components sends and receives format from remote side, we should not bother local consumers, as it is done in parent's applyFormat(), unless we had received a remote format

Protected function doOpen(): bool; override;

Opens the TCP/IP stream.

Protected function doRead(data: pointer; len: uint): uint; override;

You cannot read from a socket.

Use onDataAvailable event or override the onNewData() method to be notified when new data arrives.

Returns

This method always returns 0.

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

Sends a packet to remote side.

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

Should write data into the TCP/IP stream.

Protected function getAvailableDataLen(index: integer): uint; override;
 
Returns

This method always returns 0.

Protected function getFormatExchangeData(out data: pointer): uint; override;
 
Protected function handleSocketEvent(event: unaSocketEvent; id, connId: tConID; data: pointer; len: uint): bool; virtual;

Handles socket event.

Protected function initSocksThread(): tConID; virtual; abstract;

Initializes the TCP/IP stream socket.

Protected function isActive(): bool; override;

Returns active state of the TCP/IP stream.

Protected function onNewPacket(cmd: uint; data: pointer; len: uint; connId: tConID; worker: uint): bool; virtual;
 
Protected function onNewPacketData(dataType: int; data: pointer; len: uint): bool; virtual;

Triggers when new packet is available for the TCP/IP stream.

Protected function sendPacketToSocket(connId: tConID; seqNum, cmd: uint; out asynch: bool; data: pointer = nil; len: uint = 0; timeout: tTimeout = 78): tunaSendResult;

//

Public procedure AfterConstruction(); override;
 
Public procedure BeforeDestruction(); override;
 
Protected procedure doClose(); override;

Closes the TCP/IP stream.

Protected procedure doOnSocketEvent(sender: tObject; event: unaSocketEvent; id, connId: tConID; data: pointer; len: uint); virtual;

Fired by underlying socket provider. See also handleSocketEvent().

Protected procedure onPacketsLost(connId: tConID; lostCount: int; worker: uint); virtual;
 
Protected procedure sendFormat(connId: tConID);

Sends local format (if specified) to remote side.

Protected procedure sendGoodbye(connId: tConID); virtual; abstract;

Sends goodbye command to all underlying connections.

Properties

Published property bindTo: string read f_bindToIP write f_bindToIP;

Specifies IP address to bind to when socket is about to be open (either for listening or for connection). Default is '0.0.0.0' which means socket will bind to first available interface.

Protected property bindToPort: string read f_bindToPort write f_bindToPort;

Specifies port name/number to bind to when socket is about to be open (either for listening or for connection). Default is '0' which means socket will bind to first available port.

Public property bytesReceived: int64 read f_bytesReceived;
 
Public property bytesSent: int64 read f_bytesSent;
 
Protected property host: string read f_host write f_host;

Specifies host name (or IP address) for the client TCP/IP socket.

Public property inPacketsCount: int64 read f_inPacketsCount;

Returns number of packets received.

Public property inPacketsCrcErrors: unsigned read f_crcErrors;
 
Public property inPacketsDupCount: unsigned read f_dupCount;
 
Public property inPacketsOutOfSeq: unsigned read f_outOfSeq;
 
Published property isFormatProvider;
 
Public property localFormat: pointer read f_localFormat;
 
Published property onDataAvailable;
 
Published property onDataSent: tunavclUserDataEvent read f_onDataSent write f_onDataSent;

Triggers when new portion of data was sent to remote host.

Published property onFormatChangeAfter;
 
Published property onFormatChangeBefore;
 
Published property onPacketEvent: tunavclPacketEvent read f_onPacketEvent write f_onPacketEvent;

Triggers when new packet is available.

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

Published property onSocketEvent: tunavclSocketEvent read f_onSocketEvent write f_onSocketEvent;

Triggers when socket event occurs.

Published property onTextData: tunavclTextDataEvent read f_onTextData write f_onTextData;

Triggers when text data is available.

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

Published property onUserData: tunavclUserDataEvent read f_onUserData write f_onUserData;

Triggers when user data is available.

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

Public property outPacketsCount: int64 read f_outPacketsCount;

Returns number of packets sent.

Published property port: string read f_port write f_port;

Specifies port number for the client/server TCP/IP socket.

Published property proto: tunavclProtoType read f_proto write f_proto default unapt_UDP;

Specifies Proto for the TCP/IP socket (TCP or UDP).

Public property remoteFormat: pointer read f_remoteFormat;
 
Public property socks: unaSocks read f_socks;
 
Public property socksId: tConID read f_socksId;
 
Published property streamByteOrderInput: tunavclStreamByteOrder read f_inStreamByteOrder write f_inStreamByteOrder default unasbo_dontCare;

Specifies how to analyze the byte order and position in received data when doing PCM raw streaming. It could leave bytes as they are, always swap, or autodetect the order. Default is unasbo_dontCare (leave bytes as they are). Has meaning for RAW uncompressed streaming only.

Published property streamByteOrderOutput: tunavclStreamByteOrder read f_outStreamByteOrder write f_outStreamByteOrder default unasbo_dontCare;

Specifies how to analyze the byte order and position in data being sent when doing PCM raw streaming. It could leave bytes as they are, always swap, or autodetect the order. Default is unasbo_dontCare (leave bytes as they are). Has meaning for RAW uncompressed streaming only.

Published property streamingMode: tunavclStreamingMode read f_streamingMode write f_streamingMode default unasm_VC;

Specifies the low-level streaming mode.

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09