ArxBzFhblxphS Posted June 4, 2009 Share Posted June 4, 2009 (edited) Edited August 9, 2009 by Thanubis Link to comment Share on other sites More sharing options...
monoceres Posted June 4, 2009 Share Posted June 4, 2009 If the connection doesn't end when the host stops sending data there is no definite way to know if the hosts idles or the connection is slow. The best way seem to use a timeout, something like this: Local $timer = TimerInit() While 1 Local $recv = TCPRecv($ConnectedSocket, 524288, 1) If @error Then ExitLoop If $recv <> "" Then FileWrite($file, $recv) $timer = TimerInit() Else If TimerDiff($timer) >= 300 Then; timeout if no has arrived in 300 ms ExitLoop EndIf WEnd Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now