Sign in to follow this  
Followers 0
poisonkiller

TCPSend error

14 posts in this topic

I have a code, where I use TCPSend, and one TCPSend sets Windows API WSAGetError (copied from help file :rolleyes: ) to 9. So, I want to know, what does 9 represent in Windows API WSAGetError?

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Then it has to be my coding error, and I can't solve it. Anyone can find my error?

Edited by poisonkiller

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I thought about that error code 9, but I discovered it's not error code at all, it's just lenght of a string sent by TCPSend. But still, I can't find my error in my code. Can anyone look it over, please?

EDIT: I forgot to write, how to recall my problem. First open up my script, select first radio and press Connect. Then open up my script again, select second radio and press Connect. After that wait for both windows to load, press Open... select any file, about 5MB is best, press Add and press Send files. Press Yes for msgbox and save it wherever you want. Then, quickly, select second window (it's receiving your file) and press Cancel. A msgbox appears with text "before reciveend", press Ok and my sending program just freezes. It's like that for ~15seconds and then it's back to normal, but it hasn't send "RECIVEEND" to receiving program.

Edited by poisonkiller

Share this post


Link to post
Share on other sites

I thought about that error code 9, but I discovered it's not error code at all, it's just lenght of a string sent by TCPSend. But still, I can't find my error in my code. Can anyone look it over, please?

EDIT: I forgot to write, how to recall my problem. First open up my script, select first radio and press Connect. Then open up my script again, select second radio and press Connect. After that wait for both windows to load, press Open... select any file, about 5MB is best, press Add and press Send files. Press Yes for msgbox and save it wherever you want. Then, quickly, select second window (it's receiving your file) and press Cancel. A msgbox appears with text "before reciveend", press Ok and my sending program just freezes. It's like that for ~15seconds and then it's back to normal, but it hasn't send "RECIVEEND" to receiving program.

You are NOT checking @error after TCPSend(). Do that and post the error code, or look it up yourself and you will know what's wrong.


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I put this line

If @error Then
MsgBox(0, @extended, @error)
Else
MsgBox(0, @extended, "No error.")
EndIf

after TCPSend($connect_socket1, "RECIVEEND"), but it doesn't return any error and @extended is 0 too. So, again, why does my script freeze on that line?

Edited by poisonkiller

Share this post


Link to post
Share on other sites

I put this line

If @error Then
MsgBox(0, @extended, @error)
Else
MsgBox(0, @extended, "No error.")
EndIf

before TCPSend($connect_socket1, "RECIVEEND"), but it doesn't return any error and @extended is 0 too. So, again, why does my script freeze on that line?

not BEFORE TCPSend, AFTER!

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Damn, sorry, it was a typo, I put it after TCPSend. Modified my post before too.

Share this post


Link to post
Share on other sites

Damn, sorry, it was a typo, I put it after TCPSend. Modified my post before too.

can you please update your code (above) to contain the @error check?


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Updated.

Share this post


Link to post
Share on other sites

Updated.

hm.. I think by pressing the "cancel" button, you closed the receiving socket, but then TCPSend() should return an error. Strange... I'm sorry, I can't help you here.


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

But is it a bug or I really can't script nice file sending/receiving program in Autoit, or is it my scripting error?

Share this post


Link to post
Share on other sites

But is it a bug or I really can't script nice file sending/receiving program in Autoit, or is it my scripting error?

good question... I will do some tests with TCPSend() on a closed socket...


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Some time has passed, so, /dev/null, have you tested TCPSend()?

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