NDEVR
API Documentation
ReplyTimeout

Handles timing out certain operations such as downloads. More...

Public Types

enum  HandleMethod { Abort , Close }
 Specifies how to handle a timed-out network request. More...

Public Member Functions

 ReplyTimeout (NetworkRequest *reply, const int timeout, HandleMethod method=Abort)
 Constructs a timeout watcher for the given network request.
void refresh ()
 Resets the timeout timer, restarting the countdown.

Static Public Member Functions

static void set (NetworkRequest *reply, const int timeout, HandleMethod method=Abort)
 Convenience method to attach a timeout to a network request.

Protected Member Functions

void timerEvent (QTimerEvent *ev)
 Handles the timer event; triggers the timeout action when the timer fires.

Protected Attributes

HandleMethod m_method
 The method used to handle a timeout (Abort or Close).
int m_timeout
 The timeout duration in milliseconds.
QBasicTimer m_timer
 The basic timer used to track the timeout interval.

Detailed Description

Handles timing out certain operations such as downloads.


Definition at line 10 of file ReplyTimeout.h.

Member Enumeration Documentation

◆ HandleMethod

Specifies how to handle a timed-out network request.

Enumerator
Abort 

Abort the request immediately.

Close 

Close the request gracefully.

Definition at line 16 of file ReplyTimeout.h.

Constructor & Destructor Documentation

◆ ReplyTimeout()

ReplyTimeout::ReplyTimeout ( NetworkRequest * reply,
const int timeout,
HandleMethod method = Abort )

Constructs a timeout watcher for the given network request.

Parameters
[in]replyThe network request to monitor.
[in]timeoutThe timeout duration in milliseconds.
[in]methodHow to handle the timeout (Abort or Close).

References Abort.

Member Function Documentation

◆ set()

void ReplyTimeout::set ( NetworkRequest * reply,
const int timeout,
HandleMethod method = Abort )
static

Convenience method to attach a timeout to a network request.

Parameters
[in]replyThe network request to monitor.
[in]timeoutThe timeout duration in milliseconds.
[in]methodHow to handle the timeout.

References Abort.

◆ timerEvent()

void ReplyTimeout::timerEvent ( QTimerEvent * ev)
protected

Handles the timer event; triggers the timeout action when the timer fires.

Parameters
[in]evThe timer event.

The documentation for this class was generated from the following file: