Helper Functions

Summary
Helper Functions
Functions
_TCP_GetCmdAnalyse a packet created by _TCP_MakeCmd, and extract the packet name, the parameters, and the data
_TCP_MakeCmdCreate a packet to be sent over TCP, can have

Functions

_TCP_GetCmd

Analyse a packet created by _TCP_MakeCmd, and extract the packet name, the parameters, and the data

Syntax

_TCP_GetCmd($rData, ByRef $sCmd, ByRef $aParams, ByRef $Data)

Parameters

$rDataThe packet
$sCmdWill be filled with the packet name
$aParamsWill be filled with a 1-Based array, where Elem[0] is the number of parameters, and the other elements Elem[x], will be the parameters
$DataWill be filled with the packet’s Data

Return

Succes1
Failed0 And set @error = 1 if the packet isn’t valid

_TCP_MakeCmd

Create a packet to be sent over TCP, can have

  • A command name
  • A variable number of parameters
  • Some Data

Syntax

_TCP_MakeCmd($sCmd, $aParams, $Data)

Parameters

$sCmdCommand name
$aParamsEiter an 0-Based array containing the parameters, or a string with the parameters delimited by Chr(31)
$DataThe data of the packet, string, binary string...

Return

SuccesThe packet
Create a packet to be sent over TCP, can have
Close