Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3253 closed Bug (Duplicate)

_GetIP() never get called in the first 5 minutes after pc restart

Reported by: anonymous Owned by:
Milestone: Component: Standard UDFs
Version: 3.3.14.2 Severity: None
Keywords: _GetIP Cc:

Description

In _GetIP() there is a TimerDiff() called without a previous TimerInit().
So TimerDiff return the time in ms since the computer was started.
The problem is now If TimerDiff($hTimer) < $GETIP_TIMER will always be true
in the first $GETIP_TIMER ms since PC start and _GetIP() returns 0.

Func _GetIP()
	Local Const $GETIP_TIMER = 300000 ; Constant for how many milliseconds between each check. This is 5 minutes.
	Local Static $hTimer = 0 ; Create a static variable to store the timer handle.
	Local Static $sLastIP = 0 ; Create a static variable to store the last IP.

	If TimerDiff($hTimer) < $GETIP_TIMER And Not $sLastIP Then ; If still in the timer and $sLastIP contains a value.
		Return SetExtended(1, $sLastIP) ; Return the last IP instead and set @extended to 1.
	EndIf

.
.
.

EndFunc   ;==>_GetIP

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by anonymous

Sry. Better title would be "_GetIP() always returns 0 in the first 5 minutes after pc start"

comment:2 Changed 8 years ago by Jpm

  • Resolution set to Duplicate
  • Status changed from new to closed

This has been solved with #3210

Version 0, edited 8 years ago by Jpm (next)

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.