Sign in to follow this  
Followers 0
Mason

Checking if Connection is Still up (TCP)

5 posts in this topic

Is there a way to check if a connection still exists...say my AutoIt client crashes, and I want my server to drop the connection if it doesn't exist anymore...I couldn't see any useful functions for this but...I could be missing something.

Share this post


Link to post
Share on other sites



Maybe check if the process is still running using PROCESSEXISTS?


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

Ugh...mabe you misunderstood the problem.

I have a client/server in TCP. If the client/server crashes due to AutoIt error, or windows error, I want to let the other to know about it.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Yea...you try to receive data from it and if error is either 10054 or -1 then the connection is down...

so

while 1
$read=TCPRecv($socket,$buffer_length)
if @error=-1 OR @error=10054 then 
Msgbox(0,"","Socket is dead!")
ExitLoop
else
TrayTip("","Socket alive and well",10)
endif
wend
Edited by VicTT

[quote]Together we might liveDivided we must fall[/quote]

Share this post


Link to post
Share on other sites

Don't forget to thank me!


[quote]Together we might liveDivided we must fall[/quote]

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