IRCDCCTransfer

Inherits: RefCounted < Object

Represents an active or pending Direct Client-to-Client file transfer.

Description

Handles the status, metrics, tracking, and port mapping logic required to initiate or receive an outgoing DCC SEND block over the networking protocol layer safely utilizing asynchronous connections.

Tutorials

Properties

String

address

""

int

file_size

0

String

filename

""

String

local_path

""

int

port

0

String

remote_nick

""

Status

status

0

int

transferred

0

Type

type

0

bool

use_ipv6

false

Methods

Error

accept()

Error

cancel()

String

get_error_message() const

float

get_progress() const

int

get_resume_position() const

Error

reject()

void

set_resume_position(position: int)


Enumerations

enum Type: 🔗

Type TYPE_FILE_SEND = 0

Represents an outgoing file transfer (sending a file to a remote user).

Type TYPE_FILE_RECEIVE = 1

Represents an incoming file transfer (receiving a file from a remote user).

Type TYPE_CHAT = 2

Represents a DCC chat session (direct peer-to-peer messaging).


enum Status: 🔗

Status DCC_STATUS_PENDING = 0

The transfer has been created but not yet started.

Status DCC_STATUS_CONNECTING = 1

The transfer is attempting to establish a connection.

Status DCC_STATUS_TRANSFERRING = 2

The transfer is actively sending or receiving data.

Status DCC_STATUS_COMPLETED = 3

The transfer completed successfully.

Status DCC_STATUS_FAILED = 4

The transfer encountered an error and failed.

Status DCC_STATUS_CANCELLED = 5

The transfer was cancelled before completion.


Property Descriptions

String address = "" 🔗

Remote IP address used for the DCC connection.


int file_size = 0 🔗

  • void set_file_size(value: int)

  • int get_file_size()

Total size of the file being transferred in bytes.


String filename = "" 🔗

Name of the file being sent or received.


String local_path = "" 🔗

  • void set_local_path(value: String)

  • String get_local_path()

Local filesystem path where the file will be saved or read from.


int port = 0 🔗

  • void set_port(value: int)

  • int get_port()

Port used for the DCC connection.


String remote_nick = "" 🔗

  • void set_remote_nick(value: String)

  • String get_remote_nick()

Nickname of the remote IRC user involved in the transfer.


Status status = 0 🔗

Current status of the transfer.


int transferred = 0 🔗

  • int get_transferred()

Number of bytes transferred so far.


Type type = 0 🔗

  • void set_transfer_type(value: Type)

  • Type get_transfer_type()

Type of DCC transfer.


bool use_ipv6 = false 🔗

  • void set_use_ipv6(value: bool)

  • bool get_use_ipv6()

Whether to use IPv6 for the connection.


Method Descriptions

Error accept() 🔗

Confirms an inbound request connection asynchronously by initializing an available receiver socket and commencing the binary byte stream buffer processing immediately.


Error cancel() 🔗

Aborts an active byte transmission connection natively, closing underlying stream peers and socket structures to prevent further buffer leaking.


String get_error_message() const 🔗

Returns the error message.


float get_progress() const 🔗

Returns the calculated progression of the byte payload transition over the active stream, expressed as a generalized percentage.


int get_resume_position() const 🔗

Returns the resume position.


Error reject() 🔗

Returns reject.


void set_resume_position(position: int) 🔗

Sets the resume position. position - Position.