Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FileTransfer

Hierarchy

  • FileTransfer

Index

Constructors

Properties

Methods

Constructors

constructor

  • new FileTransfer(host: string, port?: number, timeout?: number): FileTransfer
  • Initializes a File Transfer

    Parameters

    • host: string

      TeamSpeak's File transfer Host

    • Default value port: number = 30033

      TeamSpeak's File transfer Port

    • Default value timeout: number = 8000

      Timeout for File Transfer

    Returns FileTransfer

Properties

Private buffer

buffer: Buffer[]

Private bytesreceived

bytesreceived: number = 0

Private host

host: string

Private port

port: number

Private timeout

timeout: number

Methods

download

  • download(ftkey: string, size: number): Promise<Buffer>
  • Starts the download of a File

    Parameters

    • ftkey: string

      the Filetransfer Key

    • size: number

      the Data Length

    Returns Promise<Buffer>

Private init

  • init(ftkey?: undefined | string): Promise<{ socket: Socket; timeout: ReturnType<typeof setTimeout> }>
  • connects to the File Transfer Server

    Parameters

    • Optional ftkey: undefined | string

      the Filetransfer Key

    Returns Promise<{ socket: Socket; timeout: ReturnType<typeof setTimeout> }>

    returns a Promise Object with the socket

upload

  • upload(ftkey: string, data: string | Buffer): Promise<void>
  • starts the upload of a File

    Parameters

    • ftkey: string

      the Filetransfer Key

    • data: string | Buffer

      the data to send

    Returns Promise<void>

Generated using TypeDoc