Jump to content
Sign in to follow this  
BitRot

TCPRecv returns error -1

Recommended Posts

BitRot

Hello All,

I'm currently trying out a TCP-connection, and sometimes I get an @error of -1 (minus one).

The help says that the error is a direct reflection of what "WSAGetError" (WSAGetlastError ?) returns, but I could not find any description for it.

I allso noticed that most, if not all WSA errors are in the 10000 -range, with "-1" falling far outside of it.

Is that "-1" maybe still an (undescribed) internal error (indicating a clean connection-termination) ?

Share this post


Link to post
Share on other sites
BitRot

Please include your script.

Any code will do, as long as the remote end terminates the connection (even the client/server code as is present in the help).

Share this post


Link to post
Share on other sites
jvanegmond

In that case, the answer to your initial question is: Yes, it is ment as a return value indicating a disconnection. As a disconnection is in relation to a connection a error, it is returned as such.

Edited by Manadar

Share this post


Link to post
Share on other sites
BitRot

In that case, the answer to your initial question is: Yes, it is ment as a return value indicating a disconnection. As a disconnection is in relation to a connection a error, it is returned as such.

Thank you. That makes checking for a remote-initiated disconnect a bit easier.

Now all I need to do is to find a way to add that information to AI's Help (as its not present in there). :lmao:

Edited by BitRot

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.