편집

다음을 통해 공유


ServiceBase.RequestAdditionalTime Method

Definition

Overloads

RequestAdditionalTime(Int32)

Requests additional time for a pending operation.

RequestAdditionalTime(TimeSpan)

When this method is called from OnStart, OnStop, OnPause or OnContinue, the specified wait hint is passed to the Service Control Manager to avoid having the service marked as not responding.

RequestAdditionalTime(Int32)

Source:
ServiceBase.cs
Source:
ServiceBase.cs
Source:
ServiceBase.cs

Requests additional time for a pending operation.

public:
 void RequestAdditionalTime(int milliseconds);
public void RequestAdditionalTime (int milliseconds);
[System.Runtime.InteropServices.ComVisible(false)]
public void RequestAdditionalTime (int milliseconds);
member this.RequestAdditionalTime : int -> unit
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.RequestAdditionalTime : int -> unit
Public Sub RequestAdditionalTime (milliseconds As Integer)

Parameters

milliseconds
Int32

The requested time in milliseconds.

Attributes

Exceptions

The service is not in a pending state.

Remarks

The RequestAdditionalTime method is intended to be called by the overridden OnContinue, OnPause, OnStart, or OnStop methods to request additional time for a pending operation, to prevent the Service Control Manager (SCM) from marking the service as not responding. If the pending operation is not a continue, pause, start, or stop, an InvalidOperationException is thrown.

See also

Applies to

RequestAdditionalTime(TimeSpan)

Source:
ServiceBase.cs
Source:
ServiceBase.cs
Source:
ServiceBase.cs

When this method is called from OnStart, OnStop, OnPause or OnContinue, the specified wait hint is passed to the Service Control Manager to avoid having the service marked as not responding.

public:
 void RequestAdditionalTime(TimeSpan time);
public void RequestAdditionalTime (TimeSpan time);
member this.RequestAdditionalTime : TimeSpan -> unit
Public Sub RequestAdditionalTime (time As TimeSpan)

Parameters

time
TimeSpan

The requested additional time.

Applies to