Jump to content
Sign in to follow this  


Recommended Posts

Posted Image Edited by Thanubis

Share this post

Link to post
Share on other sites

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

Broken link? PM me and I'll send you the file!

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.