AutoIT as server and Arduino + WiFi Shield as client

Hello everybody
I have a little problem: Instead of using the Arduino connected to the WiFi shield as server and communicating with it with GET requests, I now try to establish a TCP connection between my AutoIT program as server and the Arduino as client (Because the Arduino as server doesn't work right). But I can't get it working, although I used example codes.
The IP of my laptop: 192.168.2.103
The IP of the Arduino: 192.168.2.128

The AutoIT code:

Global $MainSocket = -1
Global $ConnectedSocket = -1
Local $MaxConnection = 1; Maximum Amount Of Concurrent Connections
Local $MaxLength = 512; Maximum Length Of String
Local $Port = 3178; Port Number
Local $Server = @IPAddress1; Server IpAddress
MsgBox(0,"",$Server)
TCPStartup()
$MainSocket = TCPListen($Server, $Port)
If $MainSocket = -1 Then Exit MsgBox(16, "Error", "Unable to intialize socket.")
While 1
    $Data = TCPRecv($ConnectedSocket, $MaxLength)
    If $Data = "~bye" Then
        MsgBox(16, "Session Ended", "Connection Terminated.")
        Exit
    ElseIf $Data <> "" Then
; Unconditional Receive
        MsgBox(0, "Received Packet", $Data)
    EndIf
    If $ConnectedSocket = -1 Then
        $ConnectedSocket = TCPAccept($MainSocket)
        If $ConnectedSocket <> -1 Then
; Someone Connected
            TCPSend($ConnectedSocket, "Connected!")
        EndIf
    EndIf
WEnd
Func OnAutoItExit()
    If $ConnectedSocket <> - 1 Then
        TCPSend($ConnectedSocket, "~bye")
        TCPCloseSocket($ConnectedSocket)
    EndIf
    If $MainSocket <> -1 Then TCPCloseSocket($MainSocket)
    TCPShutdown()
EndFunc;==>OnAutoItExit

The Arduino Code:

/*
  Repeating Wifi Web client
 
 This sketch connects to a a web server and makes a request
 using an Arduino Wifi shield.
 
 Circuit:
 * Wifi shield attached to pins 10, 11, 12, 13
 
 created 23 April 2012
 modifide 31 May 2012
 by Tom Igoe
 
 http://arduino.cc/en/Tutorial/WifiWebClientRepeating
 This code is in the public domain.
 */

#include <SPI.h>
#include <WiFi.h>

char ssid[] = "INSERT THE SSID";      //  your network SSID (name) 
char pass[] = "AND THE PW";   // your network password

int status = WL_IDLE_STATUS;

// Initialize the Wifi client library
WiFiClient client;

// server address:
// char server[] = "www.arduino.cc";
IPAddress server(192,168,2,103);
int port=3178;

unsigned long lastConnectionTime = 0;           // last time you connected to the server, in milliseconds
boolean lastConnected = false;                  // state of the connection last time through the main loop
const unsigned long postingInterval = 10*1000;  // delay between updates, in milliseconds

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  
  // check for the presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present"); 
    // don't continue:
    while(true);
  } 
  
  // attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:    
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
  } 
  // you're connected now, so print out the status:
  printWifiStatus();
}

void loop() {
  // if there's incoming data from the net connection.
  // send it out the serial port.  This is for debugging
  // purposes only:
  while (client.available()) {
    char c = client.read();
    Serial.write(c);
  }

  // if there's no net connection, but there was one last time
  // through the loop, then stop the client:
  if (!client.connected() && lastConnected) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
  }

  // if you're not connected, and ten seconds have passed since
  // your last connection, then connect again and send data:
  if(!client.connected() && (millis() - lastConnectionTime > postingInterval)) {
    connectserver();
  }
  // store the state of the connection for next time through
  // the loop:
  lastConnected = client.connected();
}

// this method makes a HTTP connection to the server:
void connectserver() {
  if (client.connect(server,port)) {
    Serial.println("connecting...");
    lastConnectionTime = millis();
  } 
  else {
    // if you couldn't make a connection:
    Serial.println("connection failed");
    Serial.println("disconnecting.");
    client.stop();
  }
}


void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}

The Serial Monitor:

Attempting to connect to SSID: NerdtechCorporation
SSID: NerdtechCorporation
IP Address: 192.168.2.128
signal strength (RSSI):-58 dBm
connection failed
disconnecting.
connection failed
disconnecting.
connection failed
disconnecting.
connection failed
disconnecting.
connection failed
disconnecting.
connection failed
disconnecting.
connection failed
disconnecting.
connection failed
disconnecting.
connection failed
disconnecting.

The list goes on and on. Can someone take a look and tell me why it doesn't work?