Q:

Cannot send message to TCP server

I work in a travel agency and we have been using Autoit for a while. We have a working TCP server made with Autoit but our client doesn't work. 
Here's the faulty code
$port = 1942

$addr = 192.168.101.111

$connexion = TCPConnect($addr, $port)

TCPSend("bus has arrived")

TCPCloseSocket($connexion)

A:

Welcome to StackOverflow. When posting questions, you can use the '{}' button located in the message toolbar and put your code in there so It can be read better. 
Regarding your question, there are several mistakes and things you've missed out in the code. 
When you want to do anything regarding TCP/UDP in AutoIT - you first need to start their services, then later shut them down.
In many programming languages, string variables require two "" at the start and end of the string. The same is with AutoIT.
When using TCPSend , the first parameter is the socket and the second is the message that it will send. 
Here is an example script I've written. Feel free to modify it. I've also commented stuff out. 
#Include <ButtonConstants.Au3>
#Include <EditConstants.Au3>
#Include <GUIConstantsEx.Au3>
#Include <StaticConstants.Au3>
#Include <WindowsConstants.Au3>
#Include <GUIEdit.Au3>
#Include <Misc.Au3>
#NoTrayIcon
Opt ('GUIOnEventMode', 1)

;We are using Input boxes so the user can type in the IP/Port/Msg and they will be stored as variables for later use
$IP = InputBox("SO TCP Connector", "Receiver's IP Address", "0.0.0.0", "", _
         - 1, -1, 0, 0)
$Port = InputBox("SO TCP Connector", "Receiver's Port", "80", "", _
         - 1, -1, 0, 0)
$Message = InputBox("SO TCP Connector", "Message to send", "Sample text", "", _
         - 1, -1, 0, 0)

;Starting the TCP service
TCPStartup()

;Opening a socket
$iSocket = TCPConnect($IP, $Port)

;Sending our message
TCPSend($iSocket, $Message)

;Closing the socket from before
TCPCloseSocket($iSocket)

;Stopping the TCP Service
TCPShutdown()

