TCP - kleines Problem

  • habe mal eben zwei tcp skripte erstellt, nur irgendwie kommt zwar die msgbox dass der string gesendet wurde, aber ich empfange ihn beim Server nicht...warum??

    Server:

    Spoiler anzeigen
    [autoit]

    ;=============================================================
    ; SERVER
    ;============================================================
    #include
    _GetIP()
    Global Const $sIP = @IPAddress1
    Global Const $iPort = 31758
    Global Const $iMaxLen = 2048
    Global $Socket = ""
    Global $Client[999]

    [/autoit] [autoit][/autoit] [autoit]

    $MainSocket = TCPListen($sIP, $iPort)
    $zahl = -1

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $ConnectedSocket = TCPAccept($MainSocket)
    If $ConnectedSocket > -1 Then
    $zahl = $zahl + 1
    $Client[$zahl] = $Socket ;neuer Client wird in einem Array gespeichert
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $zahl > -1 Then ;falls Verbindung besteht
    For $i = 0 To $zahl
    $Recv = TCPRecv($Client[$i], $iMaxLen)
    If $Recv <> "" Then
    ConsoleWrite($Recv & @LF)
    EndIf
    Next
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    WEnd

    [/autoit]


    Client:


    Spoiler anzeigen
    [autoit]

    ;=============================================================
    ; CLIENT
    ;============================================================

    [/autoit] [autoit][/autoit] [autoit]

    #include

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $sIP = @IPAddress1;_GetIP()
    Global Const $iPort = 31758

    [/autoit] [autoit][/autoit] [autoit]

    TCPStartup()

    [/autoit] [autoit][/autoit] [autoit]

    $ConnectedSocket = TCPConnect($sIP, $iPort)
    If $ConnectedSocket = -1 Then
    MsgBox(0, "", "Keine Verbindung hergestellt!")
    Exit
    Else
    For $i = 1 To 10
    TCPSend($ConnectedSocket, "Test String")
    Sleep(20)
    Next
    MsgBox(0, "", "TCP Send erfolgreich")
    TCPShutdown()
    EndIf

    [/autoit]

    Einmal editiert, zuletzt von Reaker (3. Januar 2010 um 22:42)

  • upps hab ich vergessen...aber geht trotzdem nicht ?( ?(

    /Edit ... in der zeit der Serverabsturzes habe ich es hinbekommen..:D

    Einmal editiert, zuletzt von Reaker (3. Januar 2010 um 22:42)