Sign in to follow this  
Followers 0
JFee

Windows API WSAGetLasterror Information?

2 posts in this topic

I'm getting a failed TCPConnect attempt, and I need to find out what WSAGetLasterror 10060 means.

Here is my code:

Global $PixIP = InputBox("IP", "Enter the IP of Pix", "192.168.53.250")
If @error = 0 Then
    TCPStartup()
    Global $pixSocket = TCPConnect($PixIP, 9999)
    MsgBox(1, "Socket Info", $pixSocket & @CRLF & @error)
    $test1 = TCPSend($pixSocket, '<COMMAND ID="30">0</COMMAND>' & Chr(0))
    If $test1 = 0 Then MsgBox(1, "FAILURE", "Send failed")
    Sleep(1000)
    TCPSend($pixSocket, '<COMMAND ID="30">0</COMMAND>' & Chr(0))
    Sleep(1000)
    TCPSend($pixSocket, '<COMMAND ID="30">0</COMMAND>' & Chr(0))
    Sleep(1000)
    TCPSend($pixSocket, '<COMMAND ID="30">0</COMMAND>' & Chr(0))
    Sleep(1000)
    TCPSend($pixSocket, '<COMMAND ID="30">0</COMMAND>' & Chr(0))
    Sleep(1000)
EndIf
TCPShutdown()

Perhaps I'm just missing something (If I ping that IP in a command prompt it works)


Regards,Josh

Share this post


Link to post
Share on other sites



I'm getting a failed TCPConnect attempt, and I need to find out what WSAGetLasterror 10060 means.

Here is my code:

Global $PixIP = InputBox("IP", "Enter the IP of Pix", "192.168.53.250")
If @error = 0 Then
    TCPStartup()
    Global $pixSocket = TCPConnect($PixIP, 9999)
    MsgBox(1, "Socket Info", $pixSocket & @CRLF & @error)
    $test1 = TCPSend($pixSocket, '<COMMAND ID="30">0</COMMAND>' & Chr(0))
    If $test1 = 0 Then MsgBox(1, "FAILURE", "Send failed")
    Sleep(1000)
    TCPSend($pixSocket, '<COMMAND ID="30">0</COMMAND>' & Chr(0))
    Sleep(1000)
    TCPSend($pixSocket, '<COMMAND ID="30">0</COMMAND>' & Chr(0))
    Sleep(1000)
    TCPSend($pixSocket, '<COMMAND ID="30">0</COMMAND>' & Chr(0))
    Sleep(1000)
    TCPSend($pixSocket, '<COMMAND ID="30">0</COMMAND>' & Chr(0))
    Sleep(1000)
EndIf
TCPShutdown()

Perhaps I'm just missing something (If I ping that IP in a command prompt it works)

Windows Sockets Error Codes

WSAETIMEDOUT

10060

Connection timed out.

A connection attempt failed because the connected party did not properly respond after a period of time, or the established connection failed because the connected host has failed to respond.


- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0