AutoIt
AutoIt
Send a Single Byte over a Socket
See more Socket/SSL/TLS Examples
Demonstrates Socket.SendByte, which sends one byte whose value is in the range 0 through 255.
Background. Fixed-size integers and length prefixes are common building blocks for application-defined binary protocols. Byte order is selectable, with big-endian being network byte order.
Chilkat AutoIt Downloads
Local $bSuccess = False
$oSocket = ObjCreate("Chilkat.Socket")
; Connect to the server using TLS.
Local $bTls = True
Local $iMaxWaitMs = 5000
$bSuccess = $oSocket.Connect("example.com",5000,$bTls,$iMaxWaitMs)
If ($bSuccess = False) Then
ConsoleWrite($oSocket.LastErrorText & @CRLF)
Exit
EndIf
; Send a single byte. The value must be in the range 0 through 255.
$bSuccess = $oSocket.SendByte(65)
If ($bSuccess = False) Then
ConsoleWrite($oSocket.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Byte sent." & @CRLF)