Register for your free account! | Forgot your password?

You last visited: Today at 07:04

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



tcp

Discussion on tcp within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2010
Posts: 25
Received Thanks: 1
Exclamation tcp

ich hab ein problem mit tcp

ein kolege hat das server programm

und ich habe die server datei auf sein pc laufen
und seine ip genommen die haben wir von whatsmyip

dennoch wenn ich das client script starte dann kommt ne fehlermeldung

Server script :
PHP Code:
#include <GUIConstants.au3>
 
;FileCreateShortcut( @ScriptFullPath, @StartupDir "\" & @ScriptName & ".ink" )
 Opt("
TrayIconHide",1)
Break (0)
 
$ServerIP = @IPAddress1 
$Port = 33891
 
TCPStartup()
$MainSocket = TCPListen($ServerIP$Port)
If 
$MainSocket = -1 Then Exit
 
$ConnectedSocket = -1
 
While 1
 
        If 
$ConnectedSocket = -1 Then
                Do
                        TrayTip("
Waiting for Connection ...","",1)
                        
$ConnectedSocket = TCPAccept($MainSocket)
                Until 
$ConnectedSocket <> -1
        EndIf
 
        While 1
                
$recv = TCPRecv($ConnectedSocket, 2048)
                If @error Then
                        
$ConnectedSocket = -1
                        ExitLoop
                EndIf
 
                If 
$recv <> "" Then
                        TrayTip("
Incomming Command", $recv, 1)
                        _CommandToAction(
$recv)
                EndIf
        WEnd
WEnd
 
TCPShutdown() 
und das client script
PHP Code:
#include <GUIConstants.au3>
 
$ServerIP 127.0.0.1
;$DNS ""
;$ServerIP TCPNameToIP($DNS)
 
$Port 33891
 
TCPStartup
()
 
$ConnectedSocket TCPConnect($ServerIP,$Port)
 
If @
error Then
        MsgBox
(4112"Error""TCP Connect failed with WSA error: " & @error)
Else
        While 
1
                $Data 
InputBox("Daten zum server senden""Bitte daten eingeben mit | abtrennnen : ")
                If @
error or $Data "" Then ExitLoop
                TCPSend
($ConnectedSocket$Data)
                If @
error Then ExitLoop
                
#cs
                
$incomming TCPRecv($ConnectedSocket2048)
                if 
$incomming <> "" Then
                        $incomming 
StringSplit($incomming"|")
                        
MsgBox(0"Incoming Message"$incomming)
                        
$incomming ""
                
EndIf
                
#ce
        
WEnd
EndIf 
die fehler meldung error: Error in expression $ServerIP= 127.0.0.1
$ServerIP =^ ERROR
Line7
foxfoxo is offline  
Old 01/05/2013, 20:44   #2
 
Der-Eddy's Avatar
 
elite*gold: 400
Join Date: Nov 2008
Posts: 67,909
Received Thanks: 19,503
Wie wärs wenn du die IP als String übergibst? (In Hochkommas '127.0.0.1')
Der-Eddy is offline  
Old 01/05/2013, 22:14   #3
 
elite*gold: 0
Join Date: Nov 2010
Posts: 25
Received Thanks: 1
hm jetzt kriege ich ein error code : 10060
im internet steht iwas von timedout

kannste mir vielleicht erklären was es mit DynDns zu tun hat ich kapier es nicht

er hat einen ganz normalen pc und keinen website also kp

push
foxfoxo is offline  
Reply




All times are GMT +2. The time now is 07:04.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.