Sign in to follow this  
Followers 0
molotofc

ff.au3 mozrepl error

4 posts in this topic

Occasionally when running an exe halfway through the exe I'm getting the error

ff.au3 error

__FFWaitForRepl ==> Error TCPSend /TCPRecv :-1

There seems no consistency, sometimes I do get this but sometimes I don't.

What does this mean and how I could rectify it?

Problem only seems to only occur on scripts thats been made into an exe file, but when run the script itself by pressing F5 on SCiTE, it is fine there.

Is this a connection related issue?

Share this post


Link to post
Share on other sites



The functionality of TCPSend / TCPRecv changed in one of the recent updates. There have been multiple forum posts regarding the issue, so you may want to search to see if you can come up with a suitable solution.

FWIW, I get this as well and have just been ignoring it.

Share this post


Link to post
Share on other sites

it very annoying bug #2596 as it blocking script execution, so i went ahead and make some changes in FF udf (it is only appearance of TCPRecv() in udf):

; #INTERNAL_USE_ONLY# ==========================================================
; Name ..........: __FFWaitForRepl
; Description ...:
; AutoIt Version : V3.3.0.0
; Syntax ........: __FFWaitForRepl($iTimeOut)
; Parameter(s): .: $iTimeOut
; Return Value ..: Success      - Return value from MozRepl
;                  Failure      - ""
;                  @ERROR       -
; Author(s) .....: Thorsten Willert
; Date ..........: Fri Dec 04 11:48:08 CET 2009
; ==============================================================================
Func __FFWaitForRepl($iTimeOut)
    Local Const $sFuncName = @CRLF & "__FFWaitForRepl"

    Local $recv, $sRet = "", $TimeOutTimer = TimerInit()
    If $iTimeOut < 200 Then $iTimeOut = 200

    While TimerDiff($TimeOutTimer) < $iTimeOut

        ; connection delay
        Sleep($_FF_CON_DELAY)

        $recv = TCPRecv($_FF_GLOBAL_SOCKET, 4096)
        ;ConsoleWrite($recv & @CRLF)
        ; TCP error
        If @error > 0 Then;If @error Then  <<<<----------------------------------------------------------------------------
            SetError(__FFError($sFuncName, $_FF_ERROR_SendRecv, "TCPRecv :" & @error))
            Return ""
        EndIf
        $sRet &= $recv

        ; error from MozRepl
        If StringRegExp($recv, "!!!(.*?)(TypeError|Exception|ReferenceError):?") Then
            $recv = StringLeft($recv, StringInStr($recv, "location") - 1)
            Sleep(200)
            SetError(__FFError($sFuncName, $_FF_ERROR_ReplException, StringStripWS($recv, 3)))
            __FFSend(";") ; MozRepl-Reset
            Sleep(200)
            Return ""
        ElseIf StringInStr($recv, "....>") Then
            __FFSend(";") ; MozRepl-Reset
            Sleep(200)
            SetError(__FFError($sFuncName, $_FF_ERROR_RetValue, "MozRepl ....>"))
            Return ""
        ElseIf StringInStr($recv, "beginning of the line to force evaluation") Then
            Sleep(500) ; first connection delay
        EndIf

        ; multiple connections to MozRepl (e.g repl2?> ...)
        If StringRegExp($recv, "repl[\d]*>") Then Return StringRegExpReplace($sRet, "repl[\d]*>", "")
    WEnd

    ; Timeout
    SetError(__FFError($sFuncName, $_FF_ERROR_Timeout, Round(TimerDiff($TimeOutTimer)) & "ms > " & $iTimeOut & "ms $iTimeOut"))
    Return ""

EndFunc   ;==>__FFWaitForRepl

Share this post


Link to post
Share on other sites

 

it very annoying bug #2596 as it blocking script execution, so i went ahead and make some changes in FF udf (it is only appearance of TCPRecv() in udf):

; #INTERNAL_USE_ONLY# ==========================================================
; Name ..........: __FFWaitForRepl
; Description ...:
; AutoIt Version : V3.3.0.0
; Syntax ........: __FFWaitForRepl($iTimeOut)
; Parameter(s): .: $iTimeOut
; Return Value ..: Success      - Return value from MozRepl
;                  Failure      - ""
;                  @ERROR       -
; Author(s) .....: Thorsten Willert
; Date ..........: Fri Dec 04 11:48:08 CET 2009
; ==============================================================================
Func __FFWaitForRepl($iTimeOut)
    Local Const $sFuncName = @CRLF & "__FFWaitForRepl"

    Local $recv, $sRet = "", $TimeOutTimer = TimerInit()
    If $iTimeOut < 200 Then $iTimeOut = 200

    While TimerDiff($TimeOutTimer) < $iTimeOut

        ; connection delay
        Sleep($_FF_CON_DELAY)

        $recv = TCPRecv($_FF_GLOBAL_SOCKET, 4096)
        ;ConsoleWrite($recv & @CRLF)
        ; TCP error
        If @error > 0 Then;If @error Then  <<<<----------------------------------------------------------------------------
            SetError(__FFError($sFuncName, $_FF_ERROR_SendRecv, "TCPRecv :" & @error))
            Return ""
        EndIf
        $sRet &= $recv

        ; error from MozRepl
        If StringRegExp($recv, "!!!(.*?)(TypeError|Exception|ReferenceError):?") Then
            $recv = StringLeft($recv, StringInStr($recv, "location") - 1)
            Sleep(200)
            SetError(__FFError($sFuncName, $_FF_ERROR_ReplException, StringStripWS($recv, 3)))
            __FFSend(";") ; MozRepl-Reset
            Sleep(200)
            Return ""
        ElseIf StringInStr($recv, "....>") Then
            __FFSend(";") ; MozRepl-Reset
            Sleep(200)
            SetError(__FFError($sFuncName, $_FF_ERROR_RetValue, "MozRepl ....>"))
            Return ""
        ElseIf StringInStr($recv, "beginning of the line to force evaluation") Then
            Sleep(500) ; first connection delay
        EndIf

        ; multiple connections to MozRepl (e.g repl2?> ...)
        If StringRegExp($recv, "repl[\d]*>") Then Return StringRegExpReplace($sRet, "repl[\d]*>", "")
    WEnd

    ; Timeout
    SetError(__FFError($sFuncName, $_FF_ERROR_Timeout, Round(TimerDiff($TimeOutTimer)) & "ms > " & $iTimeOut & "ms $iTimeOut"))
    Return ""

EndFunc   ;==>__FFWaitForRepl

I amended ff.au3 and rebuilt the exe file and it seems to have done the trick.

Thanks

1 person likes this

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