C# Class Microsoft.Protocols.TestSuites.MS_WOPI.DiscoveryRequestListener

This class is used to help the implementation of the discovery operation.
Inheritance: HelperBase, IDisposable
Show file Open project: OfficeDev/Interop-TestSuites Class Usage Examples

Public Methods

Method Description
DiscoveryRequestListener ( string hostDiscoveryMachineName, string responseXmlForDiscovery ) : System

Initializes a new instance of the DiscoveryRequestListener class.

Dispose ( ) : void

A method is used to implement the IDisposable interface, it allows the user to dispose the current instance if user need to release allocated resources.

StartListen ( ) : Thread

A method is used to start the listen thread to listen the discovery request.

StopListen ( ) : void

A method is used to stop listen process. This method will abort the thread which is listening discovery request and release all resource are used by the thread.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

A method is used to perform custom dispose logic when the GC try to collect this instance.

ListenToRequest ( ) : void

A method is used to listening the discovery request. It will be executed by a thread which is started on ListenThreadInstance method.

RestartListener ( ) : void

A method is used to restart the HTTP listener. It will dispose the original HTTP listener and then re-generate a HTTP listen instance to listen request.

SetPrefixForListener ( HttpListener listenerInstance ) : void

A method is used to set the prefix for listener.

Method Details

DiscoveryRequestListener() public method

Initializes a new instance of the DiscoveryRequestListener class.
public DiscoveryRequestListener ( string hostDiscoveryMachineName, string responseXmlForDiscovery ) : System
hostDiscoveryMachineName string A parameter represents the machine name which will listen the discovery request. The value must be the name of the current machine.
responseXmlForDiscovery string A parameter represents the discovery response which will response to WOPI server.
return System

Dispose() public method

A method is used to implement the IDisposable interface, it allows the user to dispose the current instance if user need to release allocated resources.
public Dispose ( ) : void
return void

Dispose() protected method

A method is used to perform custom dispose logic when the GC try to collect this instance.
protected Dispose ( bool disposing ) : void
disposing bool A parameter represents the disposing way, the 'true' means it is called from user code by calling IDisposable.Dispose, otherwise it means the GC is trying to process this instance.
return void

ListenToRequest() protected method

A method is used to listening the discovery request. It will be executed by a thread which is started on ListenThreadInstance method.
protected ListenToRequest ( ) : void
return void

RestartListener() protected method

A method is used to restart the HTTP listener. It will dispose the original HTTP listener and then re-generate a HTTP listen instance to listen request.
protected RestartListener ( ) : void
return void

SetPrefixForListener() protected method

A method is used to set the prefix for listener.
protected SetPrefixForListener ( HttpListener listenerInstance ) : void
listenerInstance System.Net.HttpListener A parameter represents the HttpListener instance which will be set the listened prefix.
return void

StartListen() public method

A method is used to start the listen thread to listen the discovery request.
public StartListen ( ) : Thread
return Thread

StopListen() public method

A method is used to stop listen process. This method will abort the thread which is listening discovery request and release all resource are used by the thread.
public StopListen ( ) : void
return void