This commit is contained in:
fudanyi 2014-11-07 16:52:02 +08:00
Родитель c84c3a5517
Коммит 760db3e25f
63 изменённых файлов: 104060 добавлений и 102919 удалений

Двоичные данные
Documents/LinuxNodeFiles/nm/NM

Двоичный файл не отображается.

Двоичный файл не отображается.

Двоичный файл не отображается.

Просмотреть файл

@ -1,149 +1,149 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Microsoft.Owin.Host.HttpListener</name>
</assembly>
<members>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.ExceptionFilterStream">
<summary>
This class is used to wrap other streams and convert some exception types.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.RequestHeadersDictionary">
<summary>
This wraps HttpListenerRequest's WebHeaderCollection (NameValueCollection) and adapts it to
the OWIN required IDictionary surface area. It remains fully mutable, but you will be subject
to the header validations performed by the underlying collection.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinHttpListener">
<summary>
This wraps HttpListener and exposes it as an OWIN compatible server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.#ctor">
<summary>
Creates a listener wrapper that can be configured by the user before starting.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.SetRequestProcessingLimits(System.Int32,System.Int32)">
<summary>
These are merged as one call because they should be swapped out atomically.
This controls how many requests the server attempts to process concurrently.
</summary>
<param name="maxAccepts">The maximum number of pending request receives.</param>
<param name="maxRequests">The maximum number of active requests being processed.</param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.GetRequestProcessingLimits(System.Int32@,System.Int32@)">
<summary>
</summary>
<param name="maxAccepts"></param>
<param name="maxRequests"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(System.Net.HttpListener,System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IList{System.Collections.Generic.IDictionary{System.String,System.Object}},System.Collections.Generic.IDictionary{System.String,System.Object},System.Func{System.String,System.Func{System.Diagnostics.TraceEventType,System.Int32,System.Object,System.Exception,System.Func{System.Object,System.Exception,System.String},System.Boolean}})">
<summary>
Starts the listener and request processing threads.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Dispose">
<summary>
Shuts down the listener and disposes it.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Listener">
<summary>
The HttpListener instance wrapped by this wrapper.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest">
<summary>
This wraps an HttpListenerRequest and exposes it as an OWIN environment IDictionary.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest.#ctor(System.Net.HttpListenerRequest,System.String,System.String,System.String,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest"/> class.
Uses the given request object to populate the OWIN standard keys in the environment IDictionary.
Most values are copied so that they can be mutable, but the headers collection is only wrapped.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse">
<summary>
This wraps an HttpListenerResponse, populates it with the given response fields, and relays
the response body to the underlying stream.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse.#ctor(System.Net.HttpListenerContext,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse"/> class.
Sets up the Environment with the necessary request state items.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Exception_DuplicateKey">
<summary>
Looks up a localized string similar to The key &apos;{0}&apos; is already present in the dictionary..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_AppDisonnectErrors">
<summary>
Looks up a localized string similar to App errors on disconnect notification..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_RequestProcessingException">
<summary>
Looks up a localized string similar to Exception during request processing..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnableToSetup">
<summary>
Looks up a localized string similar to Unable to resolve handles. Disconnect notifications will be ignored..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnexpectedException">
<summary>
Looks up a localized string similar to Unexpected exception..
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinServerFactory">
<summary>
Implements the Katana setup pattern for the OwinHttpListener server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Initialize(System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Advertise the capabilities of the server.
</summary>
<param name="properties"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Creates an OwinHttpListener and starts listening on the given URL.
</summary>
<param name="app">The application entry point.</param>
<param name="properties">The addresses to listen on.</param>
<returns>The OwinHttpListener. Invoke Dispose to shut down.</returns>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.WebSockets.Constants">
<summary>
Standard keys and values for use within the OWIN interfaces
</summary>
</member>
</members>
</doc>
<?xml version="1.0"?>
<doc>
<assembly>
<name>Microsoft.Owin.Host.HttpListener</name>
</assembly>
<members>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.ExceptionFilterStream">
<summary>
This class is used to wrap other streams and convert some exception types.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.RequestHeadersDictionary">
<summary>
This wraps HttpListenerRequest's WebHeaderCollection (NameValueCollection) and adapts it to
the OWIN required IDictionary surface area. It remains fully mutable, but you will be subject
to the header validations performed by the underlying collection.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinHttpListener">
<summary>
This wraps HttpListener and exposes it as an OWIN compatible server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.#ctor">
<summary>
Creates a listener wrapper that can be configured by the user before starting.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.SetRequestProcessingLimits(System.Int32,System.Int32)">
<summary>
These are merged as one call because they should be swapped out atomically.
This controls how many requests the server attempts to process concurrently.
</summary>
<param name="maxAccepts">The maximum number of pending request receives.</param>
<param name="maxRequests">The maximum number of active requests being processed.</param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.GetRequestProcessingLimits(System.Int32@,System.Int32@)">
<summary>
</summary>
<param name="maxAccepts"></param>
<param name="maxRequests"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(System.Net.HttpListener,System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IList{System.Collections.Generic.IDictionary{System.String,System.Object}},System.Collections.Generic.IDictionary{System.String,System.Object},System.Func{System.String,System.Func{System.Diagnostics.TraceEventType,System.Int32,System.Object,System.Exception,System.Func{System.Object,System.Exception,System.String},System.Boolean}})">
<summary>
Starts the listener and request processing threads.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Dispose">
<summary>
Shuts down the listener and disposes it.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Listener">
<summary>
The HttpListener instance wrapped by this wrapper.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest">
<summary>
This wraps an HttpListenerRequest and exposes it as an OWIN environment IDictionary.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest.#ctor(System.Net.HttpListenerRequest,System.String,System.String,System.String,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest"/> class.
Uses the given request object to populate the OWIN standard keys in the environment IDictionary.
Most values are copied so that they can be mutable, but the headers collection is only wrapped.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse">
<summary>
This wraps an HttpListenerResponse, populates it with the given response fields, and relays
the response body to the underlying stream.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse.#ctor(System.Net.HttpListenerContext,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse"/> class.
Sets up the Environment with the necessary request state items.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Exception_DuplicateKey">
<summary>
Looks up a localized string similar to The key &apos;{0}&apos; is already present in the dictionary..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_AppDisonnectErrors">
<summary>
Looks up a localized string similar to App errors on disconnect notification..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_RequestProcessingException">
<summary>
Looks up a localized string similar to Exception during request processing..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnableToSetup">
<summary>
Looks up a localized string similar to Unable to resolve handles. Disconnect notifications will be ignored..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnexpectedException">
<summary>
Looks up a localized string similar to Unexpected exception..
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinServerFactory">
<summary>
Implements the Katana setup pattern for the OwinHttpListener server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Initialize(System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Advertise the capabilities of the server.
</summary>
<param name="properties"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Creates an OwinHttpListener and starts listening on the given URL.
</summary>
<param name="app">The application entry point.</param>
<param name="properties">The addresses to listen on.</param>
<returns>The OwinHttpListener. Invoke Dispose to shut down.</returns>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.WebSockets.Constants">
<summary>
Standard keys and values for use within the OWIN interfaces
</summary>
</member>
</members>
</doc>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,195 +1,195 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly>
<name>System.Web.Http.Owin</name>
</assembly>
<members>
<member name="T:System.Net.Http.OwinHttpRequestMessageExtensions">
<summary>Provides extension methods for the <see cref="T:System.Net.Http.HttpRequestMessage" /> class.</summary>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.GetOwinContext(System.Net.Http.HttpRequestMessage)">
<summary>Gets the OWIN context for the specified request.</summary>
<returns>The OWIN environment for the specified context, if available; otherwise <see cref="null" />.</returns>
<param name="request">The HTTP request message.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.GetOwinEnvironment(System.Net.Http.HttpRequestMessage)">
<summary>Gets the OWIN environment for the specified request.</summary>
<returns>The OWIN environment for the specified request, if available; otherwise <see cref="null" />.</returns>
<param name="request">The HTTP request message.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.SetOwinContext(System.Net.Http.HttpRequestMessage,Microsoft.Owin.IOwinContext)">
<summary>Sets the OWIN context for the specified request.</summary>
<param name="request">The HTTP request message.</param>
<param name="context">The OWIN context to set.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.SetOwinEnvironment(System.Net.Http.HttpRequestMessage,System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>Sets the OWIN environment for the specified request.</summary>
<param name="request">The HTTP request message.</param>
<param name="environment">The OWIN environment to set.</param>
</member>
<member name="T:System.Web.Http.HostAuthenticationAttribute">
<summary>Represents an authentication attribute that authenticates via OWIN middleware.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.#ctor(System.String)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.HostAuthenticationAttribute" /> class.</summary>
<param name="authenticationType">The authentication type of the OWIN middleware to use.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationAttribute.AllowMultiple"></member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.AuthenticateAsync(System.Web.Http.Filters.HttpAuthenticationContext,System.Threading.CancellationToken)"></member>
<member name="P:System.Web.Http.HostAuthenticationAttribute.AuthenticationType">
<summary>Gets the authentication type of the OWIN middleware to use.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.ChallengeAsync(System.Web.Http.Filters.HttpAuthenticationChallengeContext,System.Threading.CancellationToken)"></member>
<member name="T:System.Web.Http.HostAuthenticationFilter">
<summary>Represents an authentication filter that authenticates via OWIN middleware.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.#ctor(System.String)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.HostAuthenticationFilter" /> class.</summary>
<param name="authenticationType">The authentication type of the OWIN middleware to use.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationFilter.AllowMultiple">
<summary>Gets a value indicating whether the filter allows multiple authentication.</summary>
<returns>true if the filter allows multiple authentication; otherwise, false.</returns>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.AuthenticateAsync(System.Web.Http.Filters.HttpAuthenticationContext,System.Threading.CancellationToken)">
<summary>Asynchronously authenticates the request.</summary>
<returns>The task that completes the authentication.</returns>
<param name="context">The authentication context.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationFilter.AuthenticationType">
<summary>Gets the authentication type of the OWIN middleware to use.</summary>
<returns>The authentication type of the OWIN middleware to use.</returns>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.ChallengeAsync(System.Web.Http.Filters.HttpAuthenticationChallengeContext,System.Threading.CancellationToken)">
<summary>Asynchronously challenges an authentication.</summary>
<returns>The task that completes the challenge.</returns>
<param name="context">The context.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
<member name="T:System.Web.Http.OwinHttpConfigurationExtensions">
<summary>Provides extension methods for the <see cref="T:System.Web.Http.HttpConfiguration" /> class.</summary>
</member>
<member name="M:System.Web.Http.OwinHttpConfigurationExtensions.SuppressDefaultHostAuthentication(System.Web.Http.HttpConfiguration)">
<summary>Enables suppression of the host's default authentication.</summary>
<param name="configuration">The server configuration.</param>
</member>
<member name="T:System.Web.Http.Owin.HttpMessageHandlerAdapter">
<summary>Represents an OWIN component that submits requests to an <see cref="T:System.Net.Http.HttpMessageHandler" /> when invoked.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.#ctor(Microsoft.Owin.OwinMiddleware,System.Net.Http.HttpMessageHandler,System.Web.Http.Hosting.IHostBufferPolicySelector)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
<param name="next">The next component in the pipeline.</param>
<param name="messageHandler">The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</param>
<param name="bufferPolicySelector">The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</param>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.#ctor(Microsoft.Owin.OwinMiddleware,System.Web.Http.Owin.HttpMessageHandlerOptions)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
<param name="next">The next component in the pipeline.</param>
<param name="options">The options to configure this adapter.</param>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.AppDisposing">
<summary>Gets the cancellation token that triggers cleanup of this component.</summary>
<returns>The cancellation token.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferPolicySelector">
<summary>Gets the <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</summary>
<returns>The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</returns>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Dispose">
<summary>Releases all resources used by the current instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Dispose(System.Boolean)">
<summary>Releases unmanaged and optionally managed resources.</summary>
<param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.ExceptionHandler">
<summary>Gets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.ExceptionLogger">
<summary>Gets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</returns>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Invoke(Microsoft.Owin.IOwinContext)">
<returns>Returns <see cref="T:System.Threading.Tasks.Task" />.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.MessageHandler">
<summary>Gets the <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</summary>
<returns>The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</returns>
</member>
<member name="T:System.Web.Http.Owin.HttpMessageHandlerOptions">
<summary>Represents the options for configuring an <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerOptions.#ctor">
<summary>Initializes a new instance of the<see cref="T:System.Web.Http.Owin.HttpMessageHandlerOptions" /> class.</summary>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.AppDisposing">
<summary>Gets or sets the <see cref="T:System.Threading.CancellationToken" /> that triggers cleanup of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</summary>
<returns>The <see cref="T:System.Threading.CancellationToken" /> that triggers cleanup of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.BufferPolicySelector">
<summary>Gets or sets the <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</summary>
<returns>The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.ExceptionHandler">
<summary>Gets or sets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.ExceptionLogger">
<summary>Gets or sets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.MessageHandler">
<summary>Gets or sets the <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</summary>
<returns>The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</returns>
</member>
<member name="T:System.Web.Http.Owin.OwinBufferPolicySelector">
<summary>Provides the default implementation of <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> used by the OWIN Web API adapter.</summary>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.#ctor">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.OwinBufferPolicySelector" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.UseBufferedInputStream(System.Object)">
<summary>Determines whether the host should buffer the HttpRequestMessage entity body.</summary>
<returns>true if buffering should be used; otherwise a streamed request should be used.</returns>
<param name="hostContext">The host context.</param>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.UseBufferedOutputStream(System.Net.Http.HttpResponseMessage)">
<summary>Determines whether the host should buffer the HttpResponseMessage entity body.</summary>
<returns>true if buffering should be used; otherwise a streamed response should be used.</returns>
<param name="response">The response.</param>
</member>
<member name="T:System.Web.Http.Owin.OwinExceptionCatchBlocks">
<summary>Provides the catch blocks used within this assembly.</summary>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterBufferContent">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferContent.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferContent.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterBufferError">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferError.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferError.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterComputeContentLength">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.ComputeContentLength.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.ComputeContentLength.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterStreamContent">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.StreamContent.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.StreamContent.</returns>
</member>
<member name="T:System.Web.Http.Owin.PassiveAuthenticationMessageHandler">
<summary>Represents a message handler that treats all OWIN authentication middleware as passive.</summary>
</member>
<member name="M:System.Web.Http.Owin.PassiveAuthenticationMessageHandler.#ctor">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.PassiveAuthenticationMessageHandler" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.PassiveAuthenticationMessageHandler.SendAsync(System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)">
<summary>Asynchronously sends a message request.</summary>
<returns>The task that completes the asynchronous operation.</returns>
<param name="request">The message request.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
</members>
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly>
<name>System.Web.Http.Owin</name>
</assembly>
<members>
<member name="T:System.Net.Http.OwinHttpRequestMessageExtensions">
<summary>Provides extension methods for the <see cref="T:System.Net.Http.HttpRequestMessage" /> class.</summary>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.GetOwinContext(System.Net.Http.HttpRequestMessage)">
<summary>Gets the OWIN context for the specified request.</summary>
<returns>The OWIN environment for the specified context, if available; otherwise <see cref="null" />.</returns>
<param name="request">The HTTP request message.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.GetOwinEnvironment(System.Net.Http.HttpRequestMessage)">
<summary>Gets the OWIN environment for the specified request.</summary>
<returns>The OWIN environment for the specified request, if available; otherwise <see cref="null" />.</returns>
<param name="request">The HTTP request message.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.SetOwinContext(System.Net.Http.HttpRequestMessage,Microsoft.Owin.IOwinContext)">
<summary>Sets the OWIN context for the specified request.</summary>
<param name="request">The HTTP request message.</param>
<param name="context">The OWIN context to set.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.SetOwinEnvironment(System.Net.Http.HttpRequestMessage,System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>Sets the OWIN environment for the specified request.</summary>
<param name="request">The HTTP request message.</param>
<param name="environment">The OWIN environment to set.</param>
</member>
<member name="T:System.Web.Http.HostAuthenticationAttribute">
<summary>Represents an authentication attribute that authenticates via OWIN middleware.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.#ctor(System.String)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.HostAuthenticationAttribute" /> class.</summary>
<param name="authenticationType">The authentication type of the OWIN middleware to use.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationAttribute.AllowMultiple"></member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.AuthenticateAsync(System.Web.Http.Filters.HttpAuthenticationContext,System.Threading.CancellationToken)"></member>
<member name="P:System.Web.Http.HostAuthenticationAttribute.AuthenticationType">
<summary>Gets the authentication type of the OWIN middleware to use.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.ChallengeAsync(System.Web.Http.Filters.HttpAuthenticationChallengeContext,System.Threading.CancellationToken)"></member>
<member name="T:System.Web.Http.HostAuthenticationFilter">
<summary>Represents an authentication filter that authenticates via OWIN middleware.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.#ctor(System.String)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.HostAuthenticationFilter" /> class.</summary>
<param name="authenticationType">The authentication type of the OWIN middleware to use.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationFilter.AllowMultiple">
<summary>Gets a value indicating whether the filter allows multiple authentication.</summary>
<returns>true if the filter allows multiple authentication; otherwise, false.</returns>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.AuthenticateAsync(System.Web.Http.Filters.HttpAuthenticationContext,System.Threading.CancellationToken)">
<summary>Asynchronously authenticates the request.</summary>
<returns>The task that completes the authentication.</returns>
<param name="context">The authentication context.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationFilter.AuthenticationType">
<summary>Gets the authentication type of the OWIN middleware to use.</summary>
<returns>The authentication type of the OWIN middleware to use.</returns>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.ChallengeAsync(System.Web.Http.Filters.HttpAuthenticationChallengeContext,System.Threading.CancellationToken)">
<summary>Asynchronously challenges an authentication.</summary>
<returns>The task that completes the challenge.</returns>
<param name="context">The context.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
<member name="T:System.Web.Http.OwinHttpConfigurationExtensions">
<summary>Provides extension methods for the <see cref="T:System.Web.Http.HttpConfiguration" /> class.</summary>
</member>
<member name="M:System.Web.Http.OwinHttpConfigurationExtensions.SuppressDefaultHostAuthentication(System.Web.Http.HttpConfiguration)">
<summary>Enables suppression of the host's default authentication.</summary>
<param name="configuration">The server configuration.</param>
</member>
<member name="T:System.Web.Http.Owin.HttpMessageHandlerAdapter">
<summary>Represents an OWIN component that submits requests to an <see cref="T:System.Net.Http.HttpMessageHandler" /> when invoked.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.#ctor(Microsoft.Owin.OwinMiddleware,System.Net.Http.HttpMessageHandler,System.Web.Http.Hosting.IHostBufferPolicySelector)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
<param name="next">The next component in the pipeline.</param>
<param name="messageHandler">The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</param>
<param name="bufferPolicySelector">The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</param>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.#ctor(Microsoft.Owin.OwinMiddleware,System.Web.Http.Owin.HttpMessageHandlerOptions)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
<param name="next">The next component in the pipeline.</param>
<param name="options">The options to configure this adapter.</param>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.AppDisposing">
<summary>Gets the cancellation token that triggers cleanup of this component.</summary>
<returns>The cancellation token.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferPolicySelector">
<summary>Gets the <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</summary>
<returns>The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</returns>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Dispose">
<summary>Releases all resources used by the current instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Dispose(System.Boolean)">
<summary>Releases unmanaged and optionally managed resources.</summary>
<param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.ExceptionHandler">
<summary>Gets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.ExceptionLogger">
<summary>Gets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</returns>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Invoke(Microsoft.Owin.IOwinContext)">
<returns>Returns <see cref="T:System.Threading.Tasks.Task" />.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.MessageHandler">
<summary>Gets the <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</summary>
<returns>The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</returns>
</member>
<member name="T:System.Web.Http.Owin.HttpMessageHandlerOptions">
<summary>Represents the options for configuring an <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerOptions.#ctor">
<summary>Initializes a new instance of the<see cref="T:System.Web.Http.Owin.HttpMessageHandlerOptions" /> class.</summary>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.AppDisposing">
<summary>Gets or sets the <see cref="T:System.Threading.CancellationToken" /> that triggers cleanup of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</summary>
<returns>The <see cref="T:System.Threading.CancellationToken" /> that triggers cleanup of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.BufferPolicySelector">
<summary>Gets or sets the <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</summary>
<returns>The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.ExceptionHandler">
<summary>Gets or sets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.ExceptionLogger">
<summary>Gets or sets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.MessageHandler">
<summary>Gets or sets the <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</summary>
<returns>The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</returns>
</member>
<member name="T:System.Web.Http.Owin.OwinBufferPolicySelector">
<summary>Provides the default implementation of <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> used by the OWIN Web API adapter.</summary>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.#ctor">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.OwinBufferPolicySelector" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.UseBufferedInputStream(System.Object)">
<summary>Determines whether the host should buffer the HttpRequestMessage entity body.</summary>
<returns>true if buffering should be used; otherwise a streamed request should be used.</returns>
<param name="hostContext">The host context.</param>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.UseBufferedOutputStream(System.Net.Http.HttpResponseMessage)">
<summary>Determines whether the host should buffer the HttpResponseMessage entity body.</summary>
<returns>true if buffering should be used; otherwise a streamed response should be used.</returns>
<param name="response">The response.</param>
</member>
<member name="T:System.Web.Http.Owin.OwinExceptionCatchBlocks">
<summary>Provides the catch blocks used within this assembly.</summary>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterBufferContent">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferContent.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferContent.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterBufferError">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferError.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferError.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterComputeContentLength">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.ComputeContentLength.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.ComputeContentLength.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterStreamContent">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.StreamContent.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.StreamContent.</returns>
</member>
<member name="T:System.Web.Http.Owin.PassiveAuthenticationMessageHandler">
<summary>Represents a message handler that treats all OWIN authentication middleware as passive.</summary>
</member>
<member name="M:System.Web.Http.Owin.PassiveAuthenticationMessageHandler.#ctor">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.PassiveAuthenticationMessageHandler" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.PassiveAuthenticationMessageHandler.SendAsync(System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)">
<summary>Asynchronously sends a message request.</summary>
<returns>The task that completes the asynchronous operation.</returns>
<param name="request">The message request.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
</members>
</doc>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,50 +1,75 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Microsoft.Hpc.Activation;
using Microsoft.Hpc.Scheduler.Communicator;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{
public class CallbackController : ApiController
{
[HttpPost]
[Route("api/{nodename}/computenodereported")]
public int ComputeNodeReported(string nodeName, [FromBody] ComputeClusterNodeInformation nodeInfo)
{
try
{
var arg = new ComputeNodeInfoEventArg(nodeInfo.Name, nodeInfo);
LinuxCommunicator.Instance.Tracer.TraceInfo("Linux ComputeNodeReported. NodeName {0}, JobCount {1}", arg.NodeName, arg.NodeInfo.Jobs.Count);
int nextPing = LinuxCommunicator.Instance.Listener.ComputeNodeReported(arg);
return nextPing;
}
catch (Exception ex)
{
LinuxCommunicator.Instance.Tracer.TraceException(ex);
}
return 5000;
}
[HttpPost]
[Route("api/{nodename}/taskcompleted")]
public NextOperation TaskCompleted(string nodeName, [FromBody] ComputeNodeTaskCompletionEventArg taskInfo)
{
try
{
LinuxCommunicator.Instance.Tracer.TraceInfo("Linux TaskCompleted. NodeName {0}, TaskMessage {1}", taskInfo.NodeName, taskInfo.TaskInfo.Message);
return LinuxCommunicator.Instance.Listener.TaskCompleted(taskInfo);
}
catch (Exception ex)
{
LinuxCommunicator.Instance.Tracer.TraceException(ex);
return NextOperation.CancelJob;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Microsoft.Hpc.Activation;
using Microsoft.Hpc.Scheduler.Communicator;
using Microsoft.Hpc.Communicators.LinuxCommunicator.Monitoring;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{
public class CallbackController : ApiController
{
[HttpPost]
[Route("api/{nodename}/computenodereported")]
public int ComputeNodeReported(string nodeName, [FromBody] ComputeClusterNodeInformation nodeInfo)
{
try
{
var arg = new ComputeNodeInfoEventArg(nodeInfo.Name, nodeInfo);
LinuxCommunicator.Instance.Tracer.TraceInfo("Linux ComputeNodeReported. NodeName {0}, JobCount {1}", arg.NodeName, arg.NodeInfo.Jobs.Count);
int nextPing = LinuxCommunicator.Instance.Listener.ComputeNodeReported(arg);
return nextPing;
}
catch (Exception ex)
{
LinuxCommunicator.Instance.Tracer.TraceException(ex);
}
return 5000;
}
[HttpPost]
[Route("api/{nodename}/taskcompleted")]
public NextOperation TaskCompleted(string nodeName, [FromBody] ComputeNodeTaskCompletionEventArg taskInfo)
{
try
{
LinuxCommunicator.Instance.Tracer.TraceInfo("Linux TaskCompleted. NodeName {0}, TaskMessage {1}", taskInfo.NodeName, taskInfo.TaskInfo.Message);
return LinuxCommunicator.Instance.Listener.TaskCompleted(taskInfo);
}
catch (Exception ex)
{
LinuxCommunicator.Instance.Tracer.TraceException(ex);
return NextOperation.CancelJob;
}
}
[HttpPost]
[Route("api/{nodename}/metricreported")]
//public int MetricReported(string nodeName, [FromBody] ComputeClusterNodeInformation metricInfo)
public int MetricReported(string nodeName, [FromBody] ComputeNodeMetricInformation metricInfo)
{
try
{
LinuxCommunicator.Instance.Tracer.TraceInfo("Linux MetricReported. NodeName {0}, Metric Time {1} ", metricInfo.Name, metricInfo.Time);
LinuxCommunicator.Instance.MetricReported(metricInfo);
return -1;
}
catch (Exception ex)
{
LinuxCommunicator.Instance.Tracer.TraceException(ex);
}
return 5000;
}
// return -1;
//}
}
}

Просмотреть файл

@ -1,216 +1,295 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Hpc.Activation;
using Microsoft.Hpc.Scheduler.Communicator;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{
public class LinuxCommunicator : IUnmanagedResourceCommunicator, IDisposable
{
private const string ResourceUriFormat = "http://{0}:50001/api/{1}/{2}";
private const string CallbackUriHeaderName = "CallbackUri";
private HttpClient client;
private WebServer server;
private CancellationTokenSource cancellationTokenSource;
private static LinuxCommunicator instance;
public LinuxCommunicator()
{
if (instance != null)
{
throw new InvalidOperationException("An instance of LinuxCommunicator already exists.");
}
instance = this;
}
public void Dispose()
{
this.server.Dispose();
this.client.Dispose();
GC.SuppressFinalize(this);
}
public static LinuxCommunicator Instance
{
get { return instance; }
}
public string LinuxServiceHost
{
get;
set;
}
public INodeCommTracing Tracer
{
get;
private set;
}
public ISchedulerCallbacks Listener
{
get;
private set;
}
public string NodeGroupName { get { return "LinuxNodes"; } }
public void Accept(ISchedulerCallbacks listener) { this.Listener = listener; }
public void SetTracer(INodeCommTracing tracer)
{
this.Tracer = tracer;
}
public bool Initialize()
{
this.Tracer.TraceInfo("Initializing LinuxCommunicator.");
this.client = new HttpClient();
this.server = new WebServer();
this.Tracer.TraceInfo("Initialized LinuxCommunicator.");
return true;
}
public bool Start()
{
this.Tracer.TraceInfo("Starting LinuxCommunicator.");
this.cancellationTokenSource = new CancellationTokenSource();
this.server.Start().Wait();
return true;
}
public bool Stop()
{
this.Tracer.TraceInfo("Stopping LinuxCommunicator.");
this.server.Stop();
this.cancellationTokenSource.Cancel();
this.cancellationTokenSource.Dispose();
this.cancellationTokenSource = null;
return true;
}
public void OnNodeStatusChange(string nodeName, bool reachable)
{
}
public void EndJob(string nodeName, EndJobArg arg, NodeCommunicatorCallBack<EndJobArg> callback)
{
this.SendRequest("endjob", "taskcompleted", nodeName, callback, arg);
}
public void EndTask(string nodeName, EndTaskArg arg, NodeCommunicatorCallBack<EndTaskArg> callback)
{
this.SendRequest("endtask", "taskcompleted", nodeName, callback, arg);
}
public void StartJobAndTask(string nodeName, StartJobAndTaskArg arg, string userName, string password, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartJobAndTaskArg> callback)
{
this.SendRequest("startjobandtask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo));
}
public void StartJobAndTaskSoftCardCred(string nodeName, StartJobAndTaskArg arg, string userName, string password, byte[] certificate, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartJobAndTaskArg> callback)
{
this.SendRequest("startjobandtask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo));
}
public void StartTask(string nodeName, StartTaskArg arg, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartTaskArg> callback)
{
this.SendRequest("starttask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo));
}
public void Ping(string nodeName)
{
this.SendRequest<NodeCommunicatorCallBackArg>("ping", "computenodereported", nodeName, (name, arg, ex) =>
{
this.Tracer.TraceInfo("Compute node {0} pinged. Ex {1}", name, ex);
}, null);
}
private void SendRequest<T>(string action, string callbackAction, string nodeName, NodeCommunicatorCallBack<T> callback, T arg) where T : NodeCommunicatorCallBackArg
{
var request = new HttpRequestMessage(HttpMethod.Post, this.GetResoureUri(nodeName, action));
request.Headers.Add(CallbackUriHeaderName, this.GetCallbackUri(nodeName, callbackAction));
var formatter = new JsonMediaTypeFormatter();
request.Content = new ObjectContent<T>(arg, formatter);
this.client.SendAsync(request, this.cancellationTokenSource.Token).ContinueWith(t =>
{
Exception ex = t.Exception;
if (ex == null)
{
try
{
t.Result.EnsureSuccessStatusCode();
}
catch (Exception e)
{
ex = e;
}
}
callback(nodeName, arg, ex);
}, this.cancellationTokenSource.Token);
}
private void SendRequest<T, T1>(string action, string callbackAction, string nodeName, NodeCommunicatorCallBack<T> callback, Tuple<T, T1> arg) where T : NodeCommunicatorCallBackArg
{
var request = new HttpRequestMessage(HttpMethod.Post, this.GetResoureUri(nodeName, action));
request.Headers.Add(CallbackUriHeaderName, this.GetCallbackUri(nodeName, callbackAction));
var formatter = new JsonMediaTypeFormatter();
request.Content = new ObjectContent<Tuple<T, T1>>(arg, formatter);
this.client.SendAsync(request, this.cancellationTokenSource.Token).ContinueWith(t =>
{
Exception ex = t.Exception;
if (ex == null)
{
try
{
t.Result.EnsureSuccessStatusCode();
}
catch (Exception e)
{
ex = e;
}
}
callback(nodeName, arg.Item1, ex);
}, this.cancellationTokenSource.Token);
}
private Uri GetResoureUri(string nodeName, string action)
{
var hostName = this.LinuxServiceHost ?? nodeName;
return new Uri(string.Format(ResourceUriFormat, hostName, nodeName, action));
//if (hostName.Contains("."))
//{
// return new Uri(string.Format(ResourceUriFormat, hostName, nodeName, action));
//}
//else
//{
// return new Uri(string.Format(ResourceUriWithDomainFormat, hostName, nodeName, action)); ;
//}
}
private string GetCallbackUri(string nodeName, string action)
{
// var callbackUri = "http://10.0.0.4:50000/api/{1}/{2}";
return string.Format("{0}/api/{1}/{2}", this.server.ListeningUri, nodeName, action);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Hpc.Activation;
using Microsoft.Hpc.Scheduler;
using Microsoft.Hpc.Scheduler.Communicator;
using System.Net;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{
public class LinuxCommunicator : IUnmanagedResourceCommunicator, IDisposable
{
private const string ResourceUriFormat = "http://{0}:50001/api/{1}/{2}";
private const string CallbackUriHeaderName = "CallbackUri";
private const string HpcFullKeyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HPC";
private const string ClusterNameKeyName = "ClusterName";
private readonly string HeadNode = (string)Microsoft.Win32.Registry.GetValue(HpcFullKeyName, ClusterNameKeyName, null);
private readonly int MonitoringPort = 9894;
private HttpClient client;
private WebServer server;
private Monitoring.CounterDataSender sender;
private Dictionary<string, Guid> nodeMap;
private CancellationTokenSource cancellationTokenSource;
private static LinuxCommunicator instance;
public LinuxCommunicator()
{
if (instance != null)
{
throw new InvalidOperationException("An instance of LinuxCommunicator already exists.");
}
instance = this;
}
public void Dispose()
{
this.sender.CloseConnection();
this.server.Dispose();
this.client.Dispose();
GC.SuppressFinalize(this);
}
public static LinuxCommunicator Instance
{
get { return instance; }
}
public string LinuxServiceHost
{
get;
set;
}
public INodeCommTracing Tracer
{
get;
private set;
}
public ISchedulerCallbacks Listener
{
get;
private set;
}
public string NodeGroupName { get { return "LinuxNodes"; } }
public void Accept(ISchedulerCallbacks listener) { this.Listener = listener; }
public void SetTracer(INodeCommTracing tracer)
{
this.Tracer = tracer;
}
public bool Initialize()
{
this.Tracer.TraceInfo("Initializing LinuxCommunicator.");
this.client = new HttpClient();
this.server = new WebServer();
if (this.HeadNode == null)
{
ArgumentNullException exp = new ArgumentNullException(ClusterNameKeyName);
Tracer.TraceError("Failed to find registry value: {0}. {1}", ClusterNameKeyName, exp);
throw exp;
}
this.sender = new Monitoring.CounterDataSender();
this.sender.OpenConnection(this.HeadNode, this.MonitoringPort);
IScheduler scheduler = new Scheduler.Scheduler();
scheduler.Connect(this.HeadNode);
this.nodeMap = new Dictionary<string, Guid>();
foreach (ISchedulerNode node in scheduler.GetNodeList(null, null))
{
this.nodeMap.Add(node.Name.ToLower(), node.Guid);
}
scheduler.Close();
this.Tracer.TraceInfo("Initialized LinuxCommunicator.");
return true;
}
public bool Start()
{
this.Tracer.TraceInfo("Starting LinuxCommunicator.");
this.cancellationTokenSource = new CancellationTokenSource();
this.server.Start().Wait();
return true;
}
public bool Stop()
{
this.Tracer.TraceInfo("Stopping LinuxCommunicator.");
this.server.Stop();
this.cancellationTokenSource.Cancel();
this.cancellationTokenSource.Dispose();
this.cancellationTokenSource = null;
return true;
}
public void OnNodeStatusChange(string nodeName, bool reachable)
{
}
public void EndJob(string nodeName, EndJobArg arg, NodeCommunicatorCallBack<EndJobArg> callback)
{
this.SendRequest("endjob", "taskcompleted", nodeName, callback, arg);
}
public void EndTask(string nodeName, EndTaskArg arg, NodeCommunicatorCallBack<EndTaskArg> callback)
{
this.SendRequest("endtask", "taskcompleted", nodeName, callback, arg);
}
public void StartJobAndTask(string nodeName, StartJobAndTaskArg arg, string userName, string password, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartJobAndTaskArg> callback)
{
this.SendRequest("startjobandtask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo));
}
public void StartJobAndTaskSoftCardCred(string nodeName, StartJobAndTaskArg arg, string userName, string password, byte[] certificate, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartJobAndTaskArg> callback)
{
this.SendRequest("startjobandtask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo));
}
public void StartTask(string nodeName, StartTaskArg arg, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartTaskArg> callback)
{
this.SendRequest("starttask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo));
}
public void Ping(string nodeName)
{
this.SendRequest<NodeCommunicatorCallBackArg>("ping", "computenodereported", nodeName, (name, arg, ex) =>
{
this.Tracer.TraceInfo("Compute node {0} pinged. Ex {1}", name, ex);
}, null);
}
private void SendRequest<T>(string action, string callbackAction, string nodeName, NodeCommunicatorCallBack<T> callback, T arg) where T : NodeCommunicatorCallBackArg
{
var request = new HttpRequestMessage(HttpMethod.Post, this.GetResoureUri(nodeName, action));
request.Headers.Add(CallbackUriHeaderName, this.GetCallbackUri(nodeName, callbackAction));
var formatter = new JsonMediaTypeFormatter();
request.Content = new ObjectContent<T>(arg, formatter);
this.client.SendAsync(request, this.cancellationTokenSource.Token).ContinueWith(t =>
{
Exception ex = t.Exception;
if (ex == null)
{
try
{
t.Result.EnsureSuccessStatusCode();
}
catch (Exception e)
{
ex = e;
}
}
callback(nodeName, arg, ex);
}, this.cancellationTokenSource.Token);
}
private void SendRequest<T, T1>(string action, string callbackAction, string nodeName, NodeCommunicatorCallBack<T> callback, Tuple<T, T1> arg) where T : NodeCommunicatorCallBackArg
{
var request = new HttpRequestMessage(HttpMethod.Post, this.GetResoureUri(nodeName, action));
request.Headers.Add(CallbackUriHeaderName, this.GetCallbackUri(nodeName, callbackAction));
var formatter = new JsonMediaTypeFormatter();
request.Content = new ObjectContent<Tuple<T, T1>>(arg, formatter);
this.client.SendAsync(request, this.cancellationTokenSource.Token).ContinueWith(t =>
{
Exception ex = t.Exception;
if (ex == null)
{
try
{
t.Result.EnsureSuccessStatusCode();
}
catch (Exception e)
{
ex = e;
}
}
callback(nodeName, arg.Item1, ex);
}, this.cancellationTokenSource.Token);
}
private Uri GetResoureUri(string nodeName, string action)
{
var hostName = this.LinuxServiceHost ?? nodeName;
return new Uri(string.Format(ResourceUriFormat, hostName, nodeName, action));
//if (hostName.Contains("."))
//{
// return new Uri(string.Format(ResourceUriFormat, hostName, nodeName, action));
//}
//else
//{
// return new Uri(string.Format(ResourceUriWithDomainFormat, hostName, nodeName, action)); ;
//}
}
private string GetCallbackUri(string nodeName, string action)
{
// var callbackUri = "http://10.0.0.4:50000/api/{1}/{2}";
return string.Format("{0}/api/{1}/{2}", this.server.ListeningUri, nodeName, action);
}
public void MetricReported(Monitoring.ComputeNodeMetricInformation MetricInfo)
{
Guid nodeid = GetNodeId(MetricInfo.Name);
if (nodeid == Guid.Empty)
{
this.Tracer.TraceWarning("Ignore MetricData from UNKNOWN Node {0}.", MetricInfo.Name);
return;
}
this.sender.SendData(nodeid, MetricInfo.GetUmids(), MetricInfo.GetValues(), MetricInfo.TickCount);
this.Tracer.TraceInfo("Send MetricData from Node {0} ({1}).", MetricInfo.Name, nodeid);
}
private Guid GetNodeId(string nodeName)
{
Guid guid = Guid.Empty;
if (string.IsNullOrEmpty(nodeName))
{
return guid;
}
string lower = nodeName.ToLower();
if (this.nodeMap.ContainsKey(lower))
{
guid = this.nodeMap[lower];
}
else
{
// new node added ? refresh the nodemap
IScheduler scheduler = new Scheduler.Scheduler();
scheduler.Connect(this.HeadNode);
foreach (ISchedulerNode node in scheduler.GetNodeList(null, null))
{
string l = node.Name.ToLower();
if (!this.nodeMap.ContainsKey(l))
{
nodeMap.Add(l, node.Guid);
}
if (l.Equals(lower))
{
guid = node.Guid;
}
}
scheduler.Close();
}
return guid;
}
}
}

Просмотреть файл

@ -1,104 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AA00383C-5CAA-47E2-AAAF-04AE2890B534}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Hpc.Communicators.LinuxCommunicator</RootNamespace>
<AssemblyName>Microsoft.Hpc.Communicators.LinuxCommunicator</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="CcpActivate, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>ref\CcpActivate.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Hpc.Scheduler.Communicator, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>ref\Microsoft.Hpc.Scheduler.Communicator.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin">
<HintPath>..\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Host.HttpListener">
<HintPath>..\packages\Microsoft.Owin.Host.HttpListener.2.0.2\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Hosting">
<HintPath>..\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Owin">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.0\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.Owin">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Owin.5.2.0\lib\net45\System.Web.Http.Owin.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CallbackController.cs" />
<Compile Include="LinuxCommunicator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
<Compile Include="TaskExtensionMethods.cs" />
<Compile Include="WebServer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<Content Include="deploy.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AA00383C-5CAA-47E2-AAAF-04AE2890B534}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Hpc.Communicators.LinuxCommunicator</RootNamespace>
<AssemblyName>Microsoft.Hpc.Communicators.LinuxCommunicator</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="CcpActivate, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>ref\CcpActivate.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Hpc.Scheduler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>ref\Microsoft.Hpc.Scheduler.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Hpc.Scheduler.Communicator, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>ref\Microsoft.Hpc.Scheduler.Communicator.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Owin">
<HintPath>..\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Host.HttpListener">
<HintPath>..\packages\Microsoft.Owin.Host.HttpListener.2.0.2\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Hosting">
<HintPath>..\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Owin">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Web.Http, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.0\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.Owin">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Owin.5.2.0\lib\net45\System.Web.Http.Owin.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CallbackController.cs" />
<Compile Include="LinuxCommunicator.cs" />
<Compile Include="Monitoring\ComputeNodeMetricInformation.cs" />
<Compile Include="Monitoring\MonitoringPacket.cs" />
<Compile Include="Monitoring\MonitoringStoreInterface.cs" />
<Compile Include="Monitoring\UDPClient.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
<Compile Include="TaskExtensionMethods.cs" />
<Compile Include="WebServer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<Content Include="deploy.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Двоичные данные
LinuxCommunicator/LinuxCommunicator.sdf

Двоичный файл не отображается.

Просмотреть файл

@ -5,6 +5,12 @@ VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinuxCommunicator", "LinuxCommunicator.csproj", "{AA00383C-5CAA-47E2-AAAF-04AE2890B534}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LinuxNodeMgr", "..\LinuxNodeMgr\LinuxNodeMgr.vcxproj", "{EA48B422-D51D-42D8-950D-38860819B473}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RequestTest", "..\RequestTest\RequestTest\RequestTest.csproj", "{2E50D1A7-786C-4660-BEB0-132B92952E1E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonitoringTest", "..\MonitoringTest\MonitoringTest\MonitoringTest.csproj", "{C10856A3-ED71-4A26-83F1-0529A5049DC3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -25,6 +31,36 @@ Global
{AA00383C-5CAA-47E2-AAAF-04AE2890B534}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{AA00383C-5CAA-47E2-AAAF-04AE2890B534}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{AA00383C-5CAA-47E2-AAAF-04AE2890B534}.Release|Win32.ActiveCfg = Release|Any CPU
{EA48B422-D51D-42D8-950D-38860819B473}.Debug|Any CPU.ActiveCfg = Debug|Win32
{EA48B422-D51D-42D8-950D-38860819B473}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{EA48B422-D51D-42D8-950D-38860819B473}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{EA48B422-D51D-42D8-950D-38860819B473}.Debug|Win32.ActiveCfg = Debug|Win32
{EA48B422-D51D-42D8-950D-38860819B473}.Debug|Win32.Build.0 = Debug|Win32
{EA48B422-D51D-42D8-950D-38860819B473}.Release|Any CPU.ActiveCfg = Release|Win32
{EA48B422-D51D-42D8-950D-38860819B473}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{EA48B422-D51D-42D8-950D-38860819B473}.Release|Mixed Platforms.Build.0 = Release|Win32
{EA48B422-D51D-42D8-950D-38860819B473}.Release|Win32.ActiveCfg = Release|Win32
{EA48B422-D51D-42D8-950D-38860819B473}.Release|Win32.Build.0 = Release|Win32
{2E50D1A7-786C-4660-BEB0-132B92952E1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E50D1A7-786C-4660-BEB0-132B92952E1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E50D1A7-786C-4660-BEB0-132B92952E1E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{2E50D1A7-786C-4660-BEB0-132B92952E1E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{2E50D1A7-786C-4660-BEB0-132B92952E1E}.Debug|Win32.ActiveCfg = Debug|Any CPU
{2E50D1A7-786C-4660-BEB0-132B92952E1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E50D1A7-786C-4660-BEB0-132B92952E1E}.Release|Any CPU.Build.0 = Release|Any CPU
{2E50D1A7-786C-4660-BEB0-132B92952E1E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{2E50D1A7-786C-4660-BEB0-132B92952E1E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{2E50D1A7-786C-4660-BEB0-132B92952E1E}.Release|Win32.ActiveCfg = Release|Any CPU
{C10856A3-ED71-4A26-83F1-0529A5049DC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C10856A3-ED71-4A26-83F1-0529A5049DC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C10856A3-ED71-4A26-83F1-0529A5049DC3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{C10856A3-ED71-4A26-83F1-0529A5049DC3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{C10856A3-ED71-4A26-83F1-0529A5049DC3}.Debug|Win32.ActiveCfg = Debug|Any CPU
{C10856A3-ED71-4A26-83F1-0529A5049DC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C10856A3-ED71-4A26-83F1-0529A5049DC3}.Release|Any CPU.Build.0 = Release|Any CPU
{C10856A3-ED71-4A26-83F1-0529A5049DC3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{C10856A3-ED71-4A26-83F1-0529A5049DC3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{C10856A3-ED71-4A26-83F1-0529A5049DC3}.Release|Win32.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Просмотреть файл

@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using Microsoft.Hpc.Activation;
using System.Runtime.Serialization;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator.Monitoring
{
/// <summary>
/// Structure of a unique metric id
/// </summary>
[Serializable]
[DataContract]
public class ComputeNodeMetricInformationUMID
{
/// <summary>
/// The metric id.
/// </summary>
[DataMember]
public UInt16 MetricId { get; set; }
/// <summary>
/// The instance id.
/// </summary>
[DataMember]
public UInt16 InstanceId { get; set; }
/// <summary>
/// Constructor
/// </summary>
public ComputeNodeMetricInformationUMID(ushort metricId, ushort instanceId)
{
this.MetricId = metricId;
this.InstanceId = instanceId;
}
public ComputeNodeMetricInformationUMID()
{
this.MetricId = 0;
this.InstanceId = 0;
}
public UMID ToUMID()
{
return new UMID(this.MetricId, this.InstanceId);
}
}
[Serializable]
[DataContract]
public class ComputeNodeMetricInformation
{
[DataMember]
public string Name { get; set; }
[DataMember]
public string Time { get; set; }
[DataMember]
public List<ComputeNodeMetricInformationUMID> Umids { get; set; }
[DataMember]
public List<float> Values { get; set; }
[DataMember]
public int TickCount { get; set; }
public ComputeNodeMetricInformation()
{
}
public UMID[] GetUmids()
{
List<UMID> list = new List<UMID>(Umids.Count);
foreach(var v in Umids){
list.Add(v.ToUMID());
}
return list.ToArray();
}
public float[] GetValues()
{
return Values.ToArray();
}
}
}

Просмотреть файл

@ -0,0 +1,39 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="UDPServer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
// <summary>
// Class the implements the common data structure for Monitoring UDP communication channel
// </summary>
//-------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator.Monitoring
{
/// <summary>
/// On wire representation of the packet.
/// </summary>
public struct CounterWirePacket
{
public int version;
public Guid uuid;
public int count;
public int tickCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 80)]
public UMID[] umids;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 80)]
public float[] values;
}
}

Просмотреть файл

@ -0,0 +1,48 @@
 //-------------------------------------------------------------------------------------------------
// <copyright file="MonitoringStoreInterface.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
// <summary>
// Definition of the IHpcMonitoringStore interface and associated types used
// to manage performance counters for the cluster.
// </summary>
//-------------------------------------------------------------------------------------------------
/// <summary>
/// The monitoring namespace.
/// </summary>
namespace Microsoft.Hpc.Communicators.LinuxCommunicator.Monitoring
{
using System;
using System.Data;
using System.Collections.Generic;
/// <summary>
/// Structure of a unique metric id
/// </summary>
[Serializable]
public struct UMID
{
/// <summary>
/// The metric id.
/// </summary>
public UInt16 MetricId;
/// <summary>
/// The instance of the metric.
/// </summary>
public UInt16 InstanceId;
/// <summary>
/// Constructor
/// </summary>
public UMID(int metricId, int instanceId)
{
this.MetricId = (UInt16)metricId;
this.InstanceId = (UInt16)instanceId;
}
}
}

Просмотреть файл

@ -0,0 +1,246 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="UDPClient.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
// <summary>
// Class that manages the sending of UDP data to the Monitoring Server.
// </summary>
//-------------------------------------------------------------------------------------------------
namespace Microsoft.Hpc.Communicators.LinuxCommunicator.Monitoring
{
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Diagnostics;
/// <summary>
/// Sends perf data to the headnode.
/// </summary>
public class CounterDataSender
{
/// <summary>
/// The udp connection we send data through.
/// </summary>
private System.Net.Sockets.UdpClient udpClient;
private object lockObj = new object();
/// <summary>
/// The packet version we support
/// </summary>
private const int SupportedVersion = 1;
/// <summary>
/// The maximum number of counters in a packet
/// </summary>
public const int MaxCountersInPacket = 80;
/// <summary>
/// The maximum size of a packet.
/// </summary>
public const int MaxCounterPacketSize = 1024;
/// <summary>
/// The port that the counter data handler listens to.
/// </summary>
private int monitoringPort;
/// <summary>
/// The head node we are sending data to
/// </summary>
private string headNode;
/// <summary>
/// Buffer to use to format the counters.
/// </summary>
IntPtr formatBuffer = IntPtr.Zero;
/// <summary>
/// Buffer to use when sending the counters
/// </summary>
byte[] wireBuffer = new byte[CounterDataSender.MaxCounterPacketSize];
/// <summary>
/// Counter wire packet
/// </summary>
CounterWirePacket packet = new CounterWirePacket();
/// <summary>
/// Constructor
/// </summary>
public CounterDataSender()
{
}
/// <summary>
/// Opens the connection.
/// </summary>
/// <param name="headNode">The node we are connecting to.</param>
/// <param name="port">The port to send data to.</param>
public void OpenConnection(string headNode, int monitoringPort)
{
lock (this.lockObj)
{
if (this.formatBuffer == IntPtr.Zero)
{
formatBuffer = Marshal.AllocHGlobal(CounterDataSender.MaxCounterPacketSize);
}
this.monitoringPort = monitoringPort;
this.headNode = headNode;
//
// Init packet
//
this.packet.version = CounterDataSender.SupportedVersion;
this.packet.umids = new UMID[CounterDataSender.MaxCountersInPacket];
this.packet.values = new float[CounterDataSender.MaxCountersInPacket];
//
// Init UDP client
//
LinuxCommunicator.Instance.Tracer.TraceInfo("Connecting UDPClient to {0}:{1}", this.headNode, this.monitoringPort);
bool bUseIPv4 = false;
if (Socket.OSSupportsIPv4)
{
LinuxCommunicator.Instance.Tracer.TraceInfo("Creating UDP Client for IPv4: ");
try
{
this.udpClient = new UdpClient(AddressFamily.InterNetwork);
bUseIPv4 = true;
}
catch (Exception ex)
{
LinuxCommunicator.Instance.Tracer.TraceError("[ERROR] Error connecting UDP Client using IPv4: {0}", ex);
}
}
if (Socket.OSSupportsIPv6 && bUseIPv4 == false)
{
LinuxCommunicator.Instance.Tracer.TraceInfo("Creating UDP Client for IPv6: ");
try
{
this.udpClient = new UdpClient(AddressFamily.InterNetworkV6);
}
catch (Exception ex)
{
LinuxCommunicator.Instance.Tracer.TraceError("[ERROR] Error connecting UDP Client using IPv6: {0}", ex);
}
}
}
}
/// <summary>
/// Closes the connection.
/// </summary>
public void CloseConnection()
{
lock (this.lockObj)
{
if (this.udpClient != null)
{
try
{
this.udpClient.Close();
}
catch (SocketException se)
{
LinuxCommunicator.Instance.Tracer.TraceError("[ERROR] Exception during CloseConnection, error code: {0}. {1}", se.ErrorCode, se);
}
this.udpClient = null;
}
if (this.formatBuffer != IntPtr.Zero)
{
Marshal.FreeHGlobal(this.formatBuffer);
this.formatBuffer = IntPtr.Zero;
}
}
}
/// <summary>
/// Sends a block of counter data to the head node.
/// </summary>
public void SendData(Guid nodeId, UMID[] umids, float[] values, int tickCount)
{
LinuxCommunicator.Instance.Tracer.TraceDetail("[VERBOSE] Sending data to {0}:{1}", this.headNode, this.monitoringPort);
for (int i = 0; i < umids.Length; i++)
{
LinuxCommunicator.Instance.Tracer.TraceDetail("[VERBOSE] {0}|{1} : {2}", umids[i].MetricId, umids[i].InstanceId, values[i]);
}
try
{
int countersSent = 0;
packet.uuid = nodeId;
packet.tickCount = tickCount;
while (countersSent < umids.Length)
{
int countersToSend = Math.Min(umids.Length - countersSent, CounterDataSender.MaxCountersInPacket);
packet.count = countersToSend;
Array.Copy(umids, countersSent, packet.umids, 0, countersToSend);
Array.Copy(values, countersSent, packet.values, 0, countersToSend);
Marshal.StructureToPtr(packet, this.formatBuffer, false);
Marshal.Copy(this.formatBuffer, this.wireBuffer, 0, (int)Marshal.SizeOf(packet));
if (Marshal.SizeOf(packet) >= CounterDataSender.MaxCounterPacketSize)
{
LinuxCommunicator.Instance.Tracer.TraceWarning("[WARNING] Too many counters in the packet, max packet size: {0}, actual packet size {1}", CounterDataSender.MaxCounterPacketSize, Marshal.SizeOf(packet));
}
// print send data
int datasize = Marshal.SizeOf(packet);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < datasize; i++)
{
sb.Append(this.wireBuffer[i].ToString() + " ");
}
LinuxCommunicator.Instance.Tracer.TraceDetail("[VERBOSE] Sending data (size={0}) : {1}", datasize, sb.ToString());
udpClient.Send(this.wireBuffer, CounterDataSender.MaxCounterPacketSize, this.headNode, this.monitoringPort);
countersSent += countersToSend;
}
}
catch (SocketException e)
{
LinuxCommunicator.Instance.Tracer.TraceError("[ERROR] Failed to send counter data due to socket exception, error code: {0}, exception {1}", e.ErrorCode, e);
// re-connect since this exception can happen if Connect is not called
this.Reconnect();
}
catch (InvalidOperationException e1)
{
LinuxCommunicator.Instance.Tracer.TraceError("[ERROR] Failed to send counter data due to invalid operation exception {0}", e1);
// re-connect since we hit following exception in bug 19454:
// The operation is not allowed on non-connected sockets.
this.Reconnect();
}
catch (Exception e2)
{
// use this catch to track any exception that is not caught in above block, then we can
// analyze the exception and take proper action here (such as reconnect etc).
LinuxCommunicator.Instance.Tracer.TraceError("[ERROR] Failed to send counter data due to exception {0}", e2);
}
}
private void Reconnect()
{
lock (this.lockObj)
{
this.CloseConnection();
this.OpenConnection(this.headNode, this.monitoringPort);
}
}
}
}

Просмотреть файл

@ -1,31 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Owin;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{
public class Startup
{
public void Configuration(IAppBuilder appBuilder)
{
var config = new HttpConfiguration();
// Web API configuration and services
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
appBuilder.UseWebApi(config);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Owin;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{
public class Startup
{
public void Configuration(IAppBuilder appBuilder)
{
var config = new HttpConfiguration();
// Web API configuration and services
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
var json = config.Formatters.JsonFormatter;
json.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects;
config.Formatters.Remove(config.Formatters.XmlFormatter);
json.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.None;
appBuilder.UseWebApi(config);
}
}
}

Просмотреть файл

@ -1,16 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{
public static class TaskExtensionMethods
{
public static void StartAndForget(this Task task)
{
// Do nothing
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{
public static class TaskExtensionMethods
{
public static void StartAndForget(this Task task)
{
// Do nothing
}
}
}

Просмотреть файл

@ -1,71 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Hpc.Scheduler.Communicator;
using Microsoft.Owin.Hosting;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{
internal class WebServer : IDisposable
{
private CancellationTokenSource source = new CancellationTokenSource();
public const string LinuxCommunicatorUriTemplate = "http://{0}:50000";
public WebServer()
{
var fqdn = Dns.GetHostEntry(Environment.MachineName).AddressList.Where(a => a.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).First().ToString();
this.ListeningUri = string.Format(LinuxCommunicatorUriTemplate, fqdn);
}
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
public string ListeningUri
{
get;
private set;
}
protected virtual void Dispose(bool isDisposing)
{
if (isDisposing )
{
this.Stop();
}
}
public async Task Start()
{
await Task.Yield();
this.source = new CancellationTokenSource();
LinuxCommunicator.Instance.Tracer.TraceInfo("Start listening on {0}", this.ListeningUri);
var webApp = WebApp.Start<Startup>(this.ListeningUri);
this.source.Token.Register(() =>
{
webApp.Dispose();
LinuxCommunicator.Instance.Tracer.TraceInfo("Stop listening on {0}", this.ListeningUri);
});
}
public void Stop()
{
if (this.source != null)
{
this.source.Cancel();
this.source.Dispose();
this.source = null;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Hpc.Scheduler.Communicator;
using Microsoft.Owin.Hosting;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{
internal class WebServer : IDisposable
{
private CancellationTokenSource source = new CancellationTokenSource();
public const string LinuxCommunicatorUriTemplate = "http://{0}:50000";
public WebServer()
{
var fqdn = Dns.GetHostEntry(Environment.MachineName).AddressList.Where(a => a.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).First().ToString();
this.ListeningUri = string.Format(LinuxCommunicatorUriTemplate, fqdn);
}
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
public string ListeningUri
{
get;
private set;
}
protected virtual void Dispose(bool isDisposing)
{
if (isDisposing )
{
this.Stop();
}
}
public async Task Start()
{
await Task.Yield();
this.source = new CancellationTokenSource();
LinuxCommunicator.Instance.Tracer.TraceInfo("Start listening on {0}", this.ListeningUri);
var webApp = WebApp.Start<Startup>(this.ListeningUri);
this.source.Token.Register(() =>
{
webApp.Dispose();
LinuxCommunicator.Instance.Tracer.TraceInfo("Stop listening on {0}", this.ListeningUri);
});
}
public void Stop()
{
if (this.source != null)
{
this.source.Cancel();
this.source.Dispose();
this.source = null;
}
}
}
}

Просмотреть файл

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Owin" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.OwinSelfHost" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.Owin" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Owin.Host.HttpListener" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Owin.Hosting" version="2.0.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Owin" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.OwinSelfHost" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.Owin" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Owin.Host.HttpListener" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Owin.Hosting" version="2.0.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
</packages>

Просмотреть файл

@ -1,31 +1,31 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Microsoft.AspNet.WebApi.Client</id>
<version>5.2.0</version>
<title>Microsoft ASP.NET Web API 2.2 Client Libraries</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
<projectUrl>http://www.asp.net/web-api</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>This package adds support for formatting and content negotiation to System.Net.Http. It includes support for JSON, XML, and form URL encoded data.</description>
<summary>This package adds support for formatting and content negotiation to System.Net.Http.</summary>
<releaseNotes>Please visit http://go.microsoft.com/fwlink/?LinkID=403010 to view the release notes.</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<language>en-US</language>
<tags>Microsoft AspNet WebApi AspNetWebApi HttpClient</tags>
<dependencies>
<group targetFramework=".NETFramework4.5">
<dependency id="Newtonsoft.Json" version="4.5.11" />
</group>
<group targetFramework=".NETPortable0.0-wp80+win+net45+wp81+wpa81">
<dependency id="Newtonsoft.Json" version="6.0.2" />
<dependency id="Microsoft.Net.Http" version="2.2.22" />
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Net.Http" targetFramework=".NETFramework4.5" />
</frameworkAssemblies>
</metadata>
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Microsoft.AspNet.WebApi.Client</id>
<version>5.2.0</version>
<title>Microsoft ASP.NET Web API 2.2 Client Libraries</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
<projectUrl>http://www.asp.net/web-api</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>This package adds support for formatting and content negotiation to System.Net.Http. It includes support for JSON, XML, and form URL encoded data.</description>
<summary>This package adds support for formatting and content negotiation to System.Net.Http.</summary>
<releaseNotes>Please visit http://go.microsoft.com/fwlink/?LinkID=403010 to view the release notes.</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<language>en-US</language>
<tags>Microsoft AspNet WebApi AspNetWebApi HttpClient</tags>
<dependencies>
<group targetFramework=".NETFramework4.5">
<dependency id="Newtonsoft.Json" version="4.5.11" />
</group>
<group targetFramework=".NETPortable0.0-wp80+win+net45+wp81+wpa81">
<dependency id="Newtonsoft.Json" version="6.0.2" />
<dependency id="Microsoft.Net.Http" version="2.2.22" />
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Net.Http" targetFramework=".NETFramework4.5" />
</frameworkAssemblies>
</metadata>
</package>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
</configuration>

Просмотреть файл

@ -1,22 +1,22 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Microsoft.AspNet.WebApi.Core</id>
<version>5.2.0</version>
<title>Microsoft ASP.NET Web API 2.2 Core Libraries</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
<projectUrl>http://www.asp.net/web-api</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>This package contains the core runtime assemblies for ASP.NET Web API. This package is used by hosts of the ASP.NET Web API runtime. To host a Web API in IIS use the Microsoft.AspNet.WebApi.WebHost package. To host a Web API in your own process use the Microsoft.AspNet.WebApi.SelfHost package.</description>
<summary>This package contains the core runtime assemblies for ASP.NET Web API.</summary>
<releaseNotes>Please visit http://go.microsoft.com/fwlink/?LinkID=403010 to view the release notes.</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<language>en-US</language>
<tags>Microsoft AspNet WebApi AspNetWebApi</tags>
<dependencies>
<dependency id="Microsoft.AspNet.WebApi.Client" version="5.2.0" />
</dependencies>
</metadata>
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Microsoft.AspNet.WebApi.Core</id>
<version>5.2.0</version>
<title>Microsoft ASP.NET Web API 2.2 Core Libraries</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
<projectUrl>http://www.asp.net/web-api</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>This package contains the core runtime assemblies for ASP.NET Web API. This package is used by hosts of the ASP.NET Web API runtime. To host a Web API in IIS use the Microsoft.AspNet.WebApi.WebHost package. To host a Web API in your own process use the Microsoft.AspNet.WebApi.SelfHost package.</description>
<summary>This package contains the core runtime assemblies for ASP.NET Web API.</summary>
<releaseNotes>Please visit http://go.microsoft.com/fwlink/?LinkID=403010 to view the release notes.</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<language>en-US</language>
<tags>Microsoft AspNet WebApi AspNetWebApi</tags>
<dependencies>
<dependency id="Microsoft.AspNet.WebApi.Client" version="5.2.0" />
</dependencies>
</metadata>
</package>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,24 +1,24 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Microsoft.AspNet.WebApi.Owin</id>
<version>5.2.0</version>
<title>Microsoft ASP.NET Web API 2.2 OWIN</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
<projectUrl>http://www.asp.net/web-api</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>This package allows you to host ASP.NET Web API within an OWIN server and provides access to additional OWIN features.</description>
<summary>This package allows you to host ASP.NET Web API within an OWIN server and provides access to additional OWIN features.</summary>
<releaseNotes>Please visit http://go.microsoft.com/fwlink/?LinkID=403010 to view the release notes.</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<language>en-US</language>
<tags>Microsoft AspNet WebApi AspNetWebApi OWIN</tags>
<dependencies>
<dependency id="Microsoft.AspNet.WebApi.Core" version="[5.2.0, 5.3.0)" />
<dependency id="Microsoft.Owin" version="2.0.2" />
<dependency id="Owin" version="1.0" />
</dependencies>
</metadata>
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Microsoft.AspNet.WebApi.Owin</id>
<version>5.2.0</version>
<title>Microsoft ASP.NET Web API 2.2 OWIN</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
<projectUrl>http://www.asp.net/web-api</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>This package allows you to host ASP.NET Web API within an OWIN server and provides access to additional OWIN features.</description>
<summary>This package allows you to host ASP.NET Web API within an OWIN server and provides access to additional OWIN features.</summary>
<releaseNotes>Please visit http://go.microsoft.com/fwlink/?LinkID=403010 to view the release notes.</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<language>en-US</language>
<tags>Microsoft AspNet WebApi AspNetWebApi OWIN</tags>
<dependencies>
<dependency id="Microsoft.AspNet.WebApi.Core" version="[5.2.0, 5.3.0)" />
<dependency id="Microsoft.Owin" version="2.0.2" />
<dependency id="Owin" version="1.0" />
</dependencies>
</metadata>
</package>

Просмотреть файл

@ -1,195 +1,195 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly>
<name>System.Web.Http.Owin</name>
</assembly>
<members>
<member name="T:System.Net.Http.OwinHttpRequestMessageExtensions">
<summary>Provides extension methods for the <see cref="T:System.Net.Http.HttpRequestMessage" /> class.</summary>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.GetOwinContext(System.Net.Http.HttpRequestMessage)">
<summary>Gets the OWIN context for the specified request.</summary>
<returns>The OWIN environment for the specified context, if available; otherwise <see cref="null" />.</returns>
<param name="request">The HTTP request message.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.GetOwinEnvironment(System.Net.Http.HttpRequestMessage)">
<summary>Gets the OWIN environment for the specified request.</summary>
<returns>The OWIN environment for the specified request, if available; otherwise <see cref="null" />.</returns>
<param name="request">The HTTP request message.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.SetOwinContext(System.Net.Http.HttpRequestMessage,Microsoft.Owin.IOwinContext)">
<summary>Sets the OWIN context for the specified request.</summary>
<param name="request">The HTTP request message.</param>
<param name="context">The OWIN context to set.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.SetOwinEnvironment(System.Net.Http.HttpRequestMessage,System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>Sets the OWIN environment for the specified request.</summary>
<param name="request">The HTTP request message.</param>
<param name="environment">The OWIN environment to set.</param>
</member>
<member name="T:System.Web.Http.HostAuthenticationAttribute">
<summary>Represents an authentication attribute that authenticates via OWIN middleware.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.#ctor(System.String)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.HostAuthenticationAttribute" /> class.</summary>
<param name="authenticationType">The authentication type of the OWIN middleware to use.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationAttribute.AllowMultiple"></member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.AuthenticateAsync(System.Web.Http.Filters.HttpAuthenticationContext,System.Threading.CancellationToken)"></member>
<member name="P:System.Web.Http.HostAuthenticationAttribute.AuthenticationType">
<summary>Gets the authentication type of the OWIN middleware to use.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.ChallengeAsync(System.Web.Http.Filters.HttpAuthenticationChallengeContext,System.Threading.CancellationToken)"></member>
<member name="T:System.Web.Http.HostAuthenticationFilter">
<summary>Represents an authentication filter that authenticates via OWIN middleware.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.#ctor(System.String)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.HostAuthenticationFilter" /> class.</summary>
<param name="authenticationType">The authentication type of the OWIN middleware to use.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationFilter.AllowMultiple">
<summary>Gets a value indicating whether the filter allows multiple authentication.</summary>
<returns>true if the filter allows multiple authentication; otherwise, false.</returns>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.AuthenticateAsync(System.Web.Http.Filters.HttpAuthenticationContext,System.Threading.CancellationToken)">
<summary>Asynchronously authenticates the request.</summary>
<returns>The task that completes the authentication.</returns>
<param name="context">The authentication context.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationFilter.AuthenticationType">
<summary>Gets the authentication type of the OWIN middleware to use.</summary>
<returns>The authentication type of the OWIN middleware to use.</returns>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.ChallengeAsync(System.Web.Http.Filters.HttpAuthenticationChallengeContext,System.Threading.CancellationToken)">
<summary>Asynchronously challenges an authentication.</summary>
<returns>The task that completes the challenge.</returns>
<param name="context">The context.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
<member name="T:System.Web.Http.OwinHttpConfigurationExtensions">
<summary>Provides extension methods for the <see cref="T:System.Web.Http.HttpConfiguration" /> class.</summary>
</member>
<member name="M:System.Web.Http.OwinHttpConfigurationExtensions.SuppressDefaultHostAuthentication(System.Web.Http.HttpConfiguration)">
<summary>Enables suppression of the host's default authentication.</summary>
<param name="configuration">The server configuration.</param>
</member>
<member name="T:System.Web.Http.Owin.HttpMessageHandlerAdapter">
<summary>Represents an OWIN component that submits requests to an <see cref="T:System.Net.Http.HttpMessageHandler" /> when invoked.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.#ctor(Microsoft.Owin.OwinMiddleware,System.Net.Http.HttpMessageHandler,System.Web.Http.Hosting.IHostBufferPolicySelector)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
<param name="next">The next component in the pipeline.</param>
<param name="messageHandler">The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</param>
<param name="bufferPolicySelector">The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</param>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.#ctor(Microsoft.Owin.OwinMiddleware,System.Web.Http.Owin.HttpMessageHandlerOptions)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
<param name="next">The next component in the pipeline.</param>
<param name="options">The options to configure this adapter.</param>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.AppDisposing">
<summary>Gets the cancellation token that triggers cleanup of this component.</summary>
<returns>The cancellation token.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferPolicySelector">
<summary>Gets the <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</summary>
<returns>The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</returns>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Dispose">
<summary>Releases all resources used by the current instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Dispose(System.Boolean)">
<summary>Releases unmanaged and optionally managed resources.</summary>
<param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.ExceptionHandler">
<summary>Gets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.ExceptionLogger">
<summary>Gets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</returns>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Invoke(Microsoft.Owin.IOwinContext)">
<returns>Returns <see cref="T:System.Threading.Tasks.Task" />.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.MessageHandler">
<summary>Gets the <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</summary>
<returns>The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</returns>
</member>
<member name="T:System.Web.Http.Owin.HttpMessageHandlerOptions">
<summary>Represents the options for configuring an <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerOptions.#ctor">
<summary>Initializes a new instance of the<see cref="T:System.Web.Http.Owin.HttpMessageHandlerOptions" /> class.</summary>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.AppDisposing">
<summary>Gets or sets the <see cref="T:System.Threading.CancellationToken" /> that triggers cleanup of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</summary>
<returns>The <see cref="T:System.Threading.CancellationToken" /> that triggers cleanup of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.BufferPolicySelector">
<summary>Gets or sets the <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</summary>
<returns>The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.ExceptionHandler">
<summary>Gets or sets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.ExceptionLogger">
<summary>Gets or sets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.MessageHandler">
<summary>Gets or sets the <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</summary>
<returns>The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</returns>
</member>
<member name="T:System.Web.Http.Owin.OwinBufferPolicySelector">
<summary>Provides the default implementation of <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> used by the OWIN Web API adapter.</summary>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.#ctor">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.OwinBufferPolicySelector" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.UseBufferedInputStream(System.Object)">
<summary>Determines whether the host should buffer the HttpRequestMessage entity body.</summary>
<returns>true if buffering should be used; otherwise a streamed request should be used.</returns>
<param name="hostContext">The host context.</param>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.UseBufferedOutputStream(System.Net.Http.HttpResponseMessage)">
<summary>Determines whether the host should buffer the HttpResponseMessage entity body.</summary>
<returns>true if buffering should be used; otherwise a streamed response should be used.</returns>
<param name="response">The response.</param>
</member>
<member name="T:System.Web.Http.Owin.OwinExceptionCatchBlocks">
<summary>Provides the catch blocks used within this assembly.</summary>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterBufferContent">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferContent.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferContent.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterBufferError">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferError.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferError.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterComputeContentLength">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.ComputeContentLength.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.ComputeContentLength.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterStreamContent">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.StreamContent.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.StreamContent.</returns>
</member>
<member name="T:System.Web.Http.Owin.PassiveAuthenticationMessageHandler">
<summary>Represents a message handler that treats all OWIN authentication middleware as passive.</summary>
</member>
<member name="M:System.Web.Http.Owin.PassiveAuthenticationMessageHandler.#ctor">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.PassiveAuthenticationMessageHandler" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.PassiveAuthenticationMessageHandler.SendAsync(System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)">
<summary>Asynchronously sends a message request.</summary>
<returns>The task that completes the asynchronous operation.</returns>
<param name="request">The message request.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
</members>
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly>
<name>System.Web.Http.Owin</name>
</assembly>
<members>
<member name="T:System.Net.Http.OwinHttpRequestMessageExtensions">
<summary>Provides extension methods for the <see cref="T:System.Net.Http.HttpRequestMessage" /> class.</summary>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.GetOwinContext(System.Net.Http.HttpRequestMessage)">
<summary>Gets the OWIN context for the specified request.</summary>
<returns>The OWIN environment for the specified context, if available; otherwise <see cref="null" />.</returns>
<param name="request">The HTTP request message.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.GetOwinEnvironment(System.Net.Http.HttpRequestMessage)">
<summary>Gets the OWIN environment for the specified request.</summary>
<returns>The OWIN environment for the specified request, if available; otherwise <see cref="null" />.</returns>
<param name="request">The HTTP request message.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.SetOwinContext(System.Net.Http.HttpRequestMessage,Microsoft.Owin.IOwinContext)">
<summary>Sets the OWIN context for the specified request.</summary>
<param name="request">The HTTP request message.</param>
<param name="context">The OWIN context to set.</param>
</member>
<member name="M:System.Net.Http.OwinHttpRequestMessageExtensions.SetOwinEnvironment(System.Net.Http.HttpRequestMessage,System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>Sets the OWIN environment for the specified request.</summary>
<param name="request">The HTTP request message.</param>
<param name="environment">The OWIN environment to set.</param>
</member>
<member name="T:System.Web.Http.HostAuthenticationAttribute">
<summary>Represents an authentication attribute that authenticates via OWIN middleware.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.#ctor(System.String)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.HostAuthenticationAttribute" /> class.</summary>
<param name="authenticationType">The authentication type of the OWIN middleware to use.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationAttribute.AllowMultiple"></member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.AuthenticateAsync(System.Web.Http.Filters.HttpAuthenticationContext,System.Threading.CancellationToken)"></member>
<member name="P:System.Web.Http.HostAuthenticationAttribute.AuthenticationType">
<summary>Gets the authentication type of the OWIN middleware to use.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationAttribute.ChallengeAsync(System.Web.Http.Filters.HttpAuthenticationChallengeContext,System.Threading.CancellationToken)"></member>
<member name="T:System.Web.Http.HostAuthenticationFilter">
<summary>Represents an authentication filter that authenticates via OWIN middleware.</summary>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.#ctor(System.String)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.HostAuthenticationFilter" /> class.</summary>
<param name="authenticationType">The authentication type of the OWIN middleware to use.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationFilter.AllowMultiple">
<summary>Gets a value indicating whether the filter allows multiple authentication.</summary>
<returns>true if the filter allows multiple authentication; otherwise, false.</returns>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.AuthenticateAsync(System.Web.Http.Filters.HttpAuthenticationContext,System.Threading.CancellationToken)">
<summary>Asynchronously authenticates the request.</summary>
<returns>The task that completes the authentication.</returns>
<param name="context">The authentication context.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
<member name="P:System.Web.Http.HostAuthenticationFilter.AuthenticationType">
<summary>Gets the authentication type of the OWIN middleware to use.</summary>
<returns>The authentication type of the OWIN middleware to use.</returns>
</member>
<member name="M:System.Web.Http.HostAuthenticationFilter.ChallengeAsync(System.Web.Http.Filters.HttpAuthenticationChallengeContext,System.Threading.CancellationToken)">
<summary>Asynchronously challenges an authentication.</summary>
<returns>The task that completes the challenge.</returns>
<param name="context">The context.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
<member name="T:System.Web.Http.OwinHttpConfigurationExtensions">
<summary>Provides extension methods for the <see cref="T:System.Web.Http.HttpConfiguration" /> class.</summary>
</member>
<member name="M:System.Web.Http.OwinHttpConfigurationExtensions.SuppressDefaultHostAuthentication(System.Web.Http.HttpConfiguration)">
<summary>Enables suppression of the host's default authentication.</summary>
<param name="configuration">The server configuration.</param>
</member>
<member name="T:System.Web.Http.Owin.HttpMessageHandlerAdapter">
<summary>Represents an OWIN component that submits requests to an <see cref="T:System.Net.Http.HttpMessageHandler" /> when invoked.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.#ctor(Microsoft.Owin.OwinMiddleware,System.Net.Http.HttpMessageHandler,System.Web.Http.Hosting.IHostBufferPolicySelector)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
<param name="next">The next component in the pipeline.</param>
<param name="messageHandler">The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</param>
<param name="bufferPolicySelector">The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</param>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.#ctor(Microsoft.Owin.OwinMiddleware,System.Web.Http.Owin.HttpMessageHandlerOptions)">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
<param name="next">The next component in the pipeline.</param>
<param name="options">The options to configure this adapter.</param>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.AppDisposing">
<summary>Gets the cancellation token that triggers cleanup of this component.</summary>
<returns>The cancellation token.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferPolicySelector">
<summary>Gets the <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</summary>
<returns>The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</returns>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Dispose">
<summary>Releases all resources used by the current instance of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Dispose(System.Boolean)">
<summary>Releases unmanaged and optionally managed resources.</summary>
<param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.ExceptionHandler">
<summary>Gets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.ExceptionLogger">
<summary>Gets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</returns>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerAdapter.Invoke(Microsoft.Owin.IOwinContext)">
<returns>Returns <see cref="T:System.Threading.Tasks.Task" />.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerAdapter.MessageHandler">
<summary>Gets the <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</summary>
<returns>The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</returns>
</member>
<member name="T:System.Web.Http.Owin.HttpMessageHandlerOptions">
<summary>Represents the options for configuring an <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</summary>
</member>
<member name="M:System.Web.Http.Owin.HttpMessageHandlerOptions.#ctor">
<summary>Initializes a new instance of the<see cref="T:System.Web.Http.Owin.HttpMessageHandlerOptions" /> class.</summary>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.AppDisposing">
<summary>Gets or sets the <see cref="T:System.Threading.CancellationToken" /> that triggers cleanup of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</summary>
<returns>The <see cref="T:System.Threading.CancellationToken" /> that triggers cleanup of the <see cref="T:System.Web.Http.Owin.HttpMessageHandlerAdapter" />.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.BufferPolicySelector">
<summary>Gets or sets the <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</summary>
<returns>The <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> that determines whether or not to buffer requests and responses.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.ExceptionHandler">
<summary>Gets or sets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionHandler" /> to use to process unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.ExceptionLogger">
<summary>Gets or sets the <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</summary>
<returns>The <see cref="T:System.Web.Http.ExceptionHandling.IExceptionLogger" /> to use to log unhandled exceptions.</returns>
</member>
<member name="P:System.Web.Http.Owin.HttpMessageHandlerOptions.MessageHandler">
<summary>Gets or sets the <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</summary>
<returns>The <see cref="T:System.Net.Http.HttpMessageHandler" /> to submit requests to.</returns>
</member>
<member name="T:System.Web.Http.Owin.OwinBufferPolicySelector">
<summary>Provides the default implementation of <see cref="T:System.Web.Http.Hosting.IHostBufferPolicySelector" /> used by the OWIN Web API adapter.</summary>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.#ctor">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.OwinBufferPolicySelector" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.UseBufferedInputStream(System.Object)">
<summary>Determines whether the host should buffer the HttpRequestMessage entity body.</summary>
<returns>true if buffering should be used; otherwise a streamed request should be used.</returns>
<param name="hostContext">The host context.</param>
</member>
<member name="M:System.Web.Http.Owin.OwinBufferPolicySelector.UseBufferedOutputStream(System.Net.Http.HttpResponseMessage)">
<summary>Determines whether the host should buffer the HttpResponseMessage entity body.</summary>
<returns>true if buffering should be used; otherwise a streamed response should be used.</returns>
<param name="response">The response.</param>
</member>
<member name="T:System.Web.Http.Owin.OwinExceptionCatchBlocks">
<summary>Provides the catch blocks used within this assembly.</summary>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterBufferContent">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferContent.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferContent.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterBufferError">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferError.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.BufferError.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterComputeContentLength">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.ComputeContentLength.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.ComputeContentLength.</returns>
</member>
<member name="P:System.Web.Http.Owin.OwinExceptionCatchBlocks.HttpMessageHandlerAdapterStreamContent">
<summary>Gets the catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.StreamContent.</summary>
<returns>The catch block in System.Web.Http.Owin.HttpMessageHandlerAdapter.StreamContent.</returns>
</member>
<member name="T:System.Web.Http.Owin.PassiveAuthenticationMessageHandler">
<summary>Represents a message handler that treats all OWIN authentication middleware as passive.</summary>
</member>
<member name="M:System.Web.Http.Owin.PassiveAuthenticationMessageHandler.#ctor">
<summary>Initializes a new instance of the <see cref="T:System.Web.Http.Owin.PassiveAuthenticationMessageHandler" /> class.</summary>
</member>
<member name="M:System.Web.Http.Owin.PassiveAuthenticationMessageHandler.SendAsync(System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)">
<summary>Asynchronously sends a message request.</summary>
<returns>The task that completes the asynchronous operation.</returns>
<param name="request">The message request.</param>
<param name="cancellationToken">The cancellation token.</param>
</member>
</members>
</doc>

Просмотреть файл

@ -1,24 +1,24 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Microsoft.AspNet.WebApi.OwinSelfHost</id>
<version>5.2.0</version>
<title>Microsoft ASP.NET Web API 2.2 OWIN Self Host</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
<projectUrl>http://www.asp.net/web-api</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>This package allows you to host ASP.NET Web API within your own process using the OWIN HttpListener server. ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.</description>
<summary>This package allows you to host ASP.NET Web API within your own process using the OWIN HttpListener server.</summary>
<releaseNotes>Please visit http://go.microsoft.com/fwlink/?LinkID=403010 to view the release notes.</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<language>en-US</language>
<tags>Microsoft AspNet WebApi AspNetWebApi OWIN</tags>
<dependencies>
<dependency id="Microsoft.AspNet.WebApi.Owin" version="[5.2.0, 5.3.0)" />
<dependency id="Microsoft.Owin.Hosting" version="2.0.2" />
<dependency id="Microsoft.Owin.Host.HttpListener" version="2.0.2" />
</dependencies>
</metadata>
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Microsoft.AspNet.WebApi.OwinSelfHost</id>
<version>5.2.0</version>
<title>Microsoft ASP.NET Web API 2.2 OWIN Self Host</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
<projectUrl>http://www.asp.net/web-api</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>This package allows you to host ASP.NET Web API within your own process using the OWIN HttpListener server. ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.</description>
<summary>This package allows you to host ASP.NET Web API within your own process using the OWIN HttpListener server.</summary>
<releaseNotes>Please visit http://go.microsoft.com/fwlink/?LinkID=403010 to view the release notes.</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<language>en-US</language>
<tags>Microsoft AspNet WebApi AspNetWebApi OWIN</tags>
<dependencies>
<dependency id="Microsoft.AspNet.WebApi.Owin" version="[5.2.0, 5.3.0)" />
<dependency id="Microsoft.Owin.Hosting" version="2.0.2" />
<dependency id="Microsoft.Owin.Host.HttpListener" version="2.0.2" />
</dependencies>
</metadata>
</package>

Просмотреть файл

@ -1,21 +1,21 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Microsoft.Owin</id>
<version>2.0.2</version>
<title>Microsoft.Owin</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_enu.htm</licenseUrl>
<projectUrl>http://katanaproject.codeplex.com/</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Provides a set of helper types and abstractions for simplifying the creation of OWIN components.</description>
<releaseNotes />
<copyright />
<language />
<tags>Microsoft OWIN Katana</tags>
<dependencies>
<dependency id="Owin" version="1.0" />
</dependencies>
</metadata>
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Microsoft.Owin</id>
<version>2.0.2</version>
<title>Microsoft.Owin</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_enu.htm</licenseUrl>
<projectUrl>http://katanaproject.codeplex.com/</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Provides a set of helper types and abstractions for simplifying the creation of OWIN components.</description>
<releaseNotes />
<copyright />
<language />
<tags>Microsoft OWIN Katana</tags>
<dependencies>
<dependency id="Owin" version="1.0" />
</dependencies>
</metadata>
</package>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,18 +1,18 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Microsoft.Owin.Host.HttpListener</id>
<version>2.0.2</version>
<title>Microsoft.Owin.Host.HttpListener</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_enu.htm</licenseUrl>
<projectUrl>http://katanaproject.codeplex.com/</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>OWIN server built on the .NET Framework's HttpListener class. Currently the default server used for self-hosting.</description>
<releaseNotes />
<copyright />
<language />
<tags>Microsoft OWIN Katana</tags>
</metadata>
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Microsoft.Owin.Host.HttpListener</id>
<version>2.0.2</version>
<title>Microsoft.Owin.Host.HttpListener</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_enu.htm</licenseUrl>
<projectUrl>http://katanaproject.codeplex.com/</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>OWIN server built on the .NET Framework's HttpListener class. Currently the default server used for self-hosting.</description>
<releaseNotes />
<copyright />
<language />
<tags>Microsoft OWIN Katana</tags>
</metadata>
</package>

Просмотреть файл

@ -1,150 +1,150 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Microsoft.Owin.Host.HttpListener</name>
</assembly>
<members>
<member name="T:System.Reflection.AssemblyMetadataAttribute">
<summary>
Provided as a down-level stub for the 4.5 AssemblyMetaDataAttribute class.
All released assemblies should define [AssemblyMetadata("Serviceable", "True")].
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.ExceptionFilterStream">
<summary>
This class is used to wrap other streams and convert some exception types.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.RequestHeadersDictionary">
<summary>
This wraps HttpListenerRequest's WebHeaderCollection (NameValueCollection) and adapts it to
the OWIN required IDictionary surface area. It remains fully mutable, but you will be subject
to the header validations performed by the underlying collection.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinHttpListener">
<summary>
This wraps HttpListener and exposes it as an OWIN compatible server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.#ctor">
<summary>
Creates a listener wrapper that can be configured by the user before starting.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.SetRequestProcessingLimits(System.Int32,System.Int32)">
<summary>
These are merged as one call because they should be swapped out atomically.
This controls how many requests the server attempts to process concurrently.
</summary>
<param name="maxAccepts">The maximum number of pending request receives.</param>
<param name="maxRequests">The maximum number of active requests being processed.</param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.GetRequestProcessingLimits(System.Int32@,System.Int32@)">
<summary>
</summary>
<param name="maxAccepts"></param>
<param name="maxRequests"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(System.Net.HttpListener,System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IList{System.Collections.Generic.IDictionary{System.String,System.Object}},System.Collections.Generic.IDictionary{System.String,System.Object},System.Func{System.String,System.Func{System.Diagnostics.TraceEventType,System.Int32,System.Object,System.Exception,System.Func{System.Object,System.Exception,System.String},System.Boolean}})">
<summary>
Starts the listener and request processing threads.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Dispose">
<summary>
Shuts down the listener and disposes it.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Listener">
<summary>
The HttpListener instance wrapped by this wrapper.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest">
<summary>
This wraps an HttpListenerRequest and exposes it as an OWIN environment IDictionary.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest.#ctor(System.Net.HttpListenerRequest,System.String,System.String,System.String,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest"/> class.
Uses the given request object to populate the OWIN standard keys in the environment IDictionary.
Most values are copied so that they can be mutable, but the headers collection is only wrapped.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse">
<summary>
This wraps an HttpListenerResponse, populates it with the given response fields, and relays
the response body to the underlying stream.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse.#ctor(System.Net.HttpListenerContext,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse"/> class.
Sets up the Environment with the necessary request state items.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Exception_DuplicateKey">
<summary>
Looks up a localized string similar to The key &apos;{0}&apos; is already present in the dictionary..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_AppDisonnectErrors">
<summary>
Looks up a localized string similar to App errors on disconnect notification..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_RequestProcessingException">
<summary>
Looks up a localized string similar to Exception during request processing..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnableToSetup">
<summary>
Looks up a localized string similar to Unable to resolve handles. Disconnect notifications will be ignored..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnexpectedException">
<summary>
Looks up a localized string similar to Unexpected exception..
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinServerFactory">
<summary>
Implements the Katana setup pattern for the OwinHttpListener server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Initialize(System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Advertise the capabilities of the server.
</summary>
<param name="properties"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Creates an OwinHttpListener and starts listening on the given URL.
</summary>
<param name="app">The application entry point.</param>
<param name="properties">The addresses to listen on.</param>
<returns>The OwinHttpListener. Invoke Dispose to shut down.</returns>
</member>
</members>
</doc>
<?xml version="1.0"?>
<doc>
<assembly>
<name>Microsoft.Owin.Host.HttpListener</name>
</assembly>
<members>
<member name="T:System.Reflection.AssemblyMetadataAttribute">
<summary>
Provided as a down-level stub for the 4.5 AssemblyMetaDataAttribute class.
All released assemblies should define [AssemblyMetadata("Serviceable", "True")].
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.ExceptionFilterStream">
<summary>
This class is used to wrap other streams and convert some exception types.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.RequestHeadersDictionary">
<summary>
This wraps HttpListenerRequest's WebHeaderCollection (NameValueCollection) and adapts it to
the OWIN required IDictionary surface area. It remains fully mutable, but you will be subject
to the header validations performed by the underlying collection.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinHttpListener">
<summary>
This wraps HttpListener and exposes it as an OWIN compatible server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.#ctor">
<summary>
Creates a listener wrapper that can be configured by the user before starting.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.SetRequestProcessingLimits(System.Int32,System.Int32)">
<summary>
These are merged as one call because they should be swapped out atomically.
This controls how many requests the server attempts to process concurrently.
</summary>
<param name="maxAccepts">The maximum number of pending request receives.</param>
<param name="maxRequests">The maximum number of active requests being processed.</param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.GetRequestProcessingLimits(System.Int32@,System.Int32@)">
<summary>
</summary>
<param name="maxAccepts"></param>
<param name="maxRequests"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(System.Net.HttpListener,System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IList{System.Collections.Generic.IDictionary{System.String,System.Object}},System.Collections.Generic.IDictionary{System.String,System.Object},System.Func{System.String,System.Func{System.Diagnostics.TraceEventType,System.Int32,System.Object,System.Exception,System.Func{System.Object,System.Exception,System.String},System.Boolean}})">
<summary>
Starts the listener and request processing threads.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Dispose">
<summary>
Shuts down the listener and disposes it.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Listener">
<summary>
The HttpListener instance wrapped by this wrapper.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest">
<summary>
This wraps an HttpListenerRequest and exposes it as an OWIN environment IDictionary.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest.#ctor(System.Net.HttpListenerRequest,System.String,System.String,System.String,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest"/> class.
Uses the given request object to populate the OWIN standard keys in the environment IDictionary.
Most values are copied so that they can be mutable, but the headers collection is only wrapped.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse">
<summary>
This wraps an HttpListenerResponse, populates it with the given response fields, and relays
the response body to the underlying stream.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse.#ctor(System.Net.HttpListenerContext,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse"/> class.
Sets up the Environment with the necessary request state items.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Exception_DuplicateKey">
<summary>
Looks up a localized string similar to The key &apos;{0}&apos; is already present in the dictionary..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_AppDisonnectErrors">
<summary>
Looks up a localized string similar to App errors on disconnect notification..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_RequestProcessingException">
<summary>
Looks up a localized string similar to Exception during request processing..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnableToSetup">
<summary>
Looks up a localized string similar to Unable to resolve handles. Disconnect notifications will be ignored..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnexpectedException">
<summary>
Looks up a localized string similar to Unexpected exception..
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinServerFactory">
<summary>
Implements the Katana setup pattern for the OwinHttpListener server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Initialize(System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Advertise the capabilities of the server.
</summary>
<param name="properties"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Creates an OwinHttpListener and starts listening on the given URL.
</summary>
<param name="app">The application entry point.</param>
<param name="properties">The addresses to listen on.</param>
<returns>The OwinHttpListener. Invoke Dispose to shut down.</returns>
</member>
</members>
</doc>

Просмотреть файл

@ -1,149 +1,149 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Microsoft.Owin.Host.HttpListener</name>
</assembly>
<members>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.ExceptionFilterStream">
<summary>
This class is used to wrap other streams and convert some exception types.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.RequestHeadersDictionary">
<summary>
This wraps HttpListenerRequest's WebHeaderCollection (NameValueCollection) and adapts it to
the OWIN required IDictionary surface area. It remains fully mutable, but you will be subject
to the header validations performed by the underlying collection.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinHttpListener">
<summary>
This wraps HttpListener and exposes it as an OWIN compatible server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.#ctor">
<summary>
Creates a listener wrapper that can be configured by the user before starting.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.SetRequestProcessingLimits(System.Int32,System.Int32)">
<summary>
These are merged as one call because they should be swapped out atomically.
This controls how many requests the server attempts to process concurrently.
</summary>
<param name="maxAccepts">The maximum number of pending request receives.</param>
<param name="maxRequests">The maximum number of active requests being processed.</param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.GetRequestProcessingLimits(System.Int32@,System.Int32@)">
<summary>
</summary>
<param name="maxAccepts"></param>
<param name="maxRequests"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(System.Net.HttpListener,System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IList{System.Collections.Generic.IDictionary{System.String,System.Object}},System.Collections.Generic.IDictionary{System.String,System.Object},System.Func{System.String,System.Func{System.Diagnostics.TraceEventType,System.Int32,System.Object,System.Exception,System.Func{System.Object,System.Exception,System.String},System.Boolean}})">
<summary>
Starts the listener and request processing threads.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Dispose">
<summary>
Shuts down the listener and disposes it.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Listener">
<summary>
The HttpListener instance wrapped by this wrapper.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest">
<summary>
This wraps an HttpListenerRequest and exposes it as an OWIN environment IDictionary.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest.#ctor(System.Net.HttpListenerRequest,System.String,System.String,System.String,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest"/> class.
Uses the given request object to populate the OWIN standard keys in the environment IDictionary.
Most values are copied so that they can be mutable, but the headers collection is only wrapped.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse">
<summary>
This wraps an HttpListenerResponse, populates it with the given response fields, and relays
the response body to the underlying stream.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse.#ctor(System.Net.HttpListenerContext,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse"/> class.
Sets up the Environment with the necessary request state items.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Exception_DuplicateKey">
<summary>
Looks up a localized string similar to The key &apos;{0}&apos; is already present in the dictionary..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_AppDisonnectErrors">
<summary>
Looks up a localized string similar to App errors on disconnect notification..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_RequestProcessingException">
<summary>
Looks up a localized string similar to Exception during request processing..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnableToSetup">
<summary>
Looks up a localized string similar to Unable to resolve handles. Disconnect notifications will be ignored..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnexpectedException">
<summary>
Looks up a localized string similar to Unexpected exception..
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinServerFactory">
<summary>
Implements the Katana setup pattern for the OwinHttpListener server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Initialize(System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Advertise the capabilities of the server.
</summary>
<param name="properties"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Creates an OwinHttpListener and starts listening on the given URL.
</summary>
<param name="app">The application entry point.</param>
<param name="properties">The addresses to listen on.</param>
<returns>The OwinHttpListener. Invoke Dispose to shut down.</returns>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.WebSockets.Constants">
<summary>
Standard keys and values for use within the OWIN interfaces
</summary>
</member>
</members>
</doc>
<?xml version="1.0"?>
<doc>
<assembly>
<name>Microsoft.Owin.Host.HttpListener</name>
</assembly>
<members>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.ExceptionFilterStream">
<summary>
This class is used to wrap other streams and convert some exception types.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.RequestHeadersDictionary">
<summary>
This wraps HttpListenerRequest's WebHeaderCollection (NameValueCollection) and adapts it to
the OWIN required IDictionary surface area. It remains fully mutable, but you will be subject
to the header validations performed by the underlying collection.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinHttpListener">
<summary>
This wraps HttpListener and exposes it as an OWIN compatible server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.#ctor">
<summary>
Creates a listener wrapper that can be configured by the user before starting.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.SetRequestProcessingLimits(System.Int32,System.Int32)">
<summary>
These are merged as one call because they should be swapped out atomically.
This controls how many requests the server attempts to process concurrently.
</summary>
<param name="maxAccepts">The maximum number of pending request receives.</param>
<param name="maxRequests">The maximum number of active requests being processed.</param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.GetRequestProcessingLimits(System.Int32@,System.Int32@)">
<summary>
</summary>
<param name="maxAccepts"></param>
<param name="maxRequests"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(System.Net.HttpListener,System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IList{System.Collections.Generic.IDictionary{System.String,System.Object}},System.Collections.Generic.IDictionary{System.String,System.Object},System.Func{System.String,System.Func{System.Diagnostics.TraceEventType,System.Int32,System.Object,System.Exception,System.Func{System.Object,System.Exception,System.String},System.Boolean}})">
<summary>
Starts the listener and request processing threads.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Dispose">
<summary>
Shuts down the listener and disposes it.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.OwinHttpListener.Listener">
<summary>
The HttpListener instance wrapped by this wrapper.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest">
<summary>
This wraps an HttpListenerRequest and exposes it as an OWIN environment IDictionary.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest.#ctor(System.Net.HttpListenerRequest,System.String,System.String,System.String,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerRequest"/> class.
Uses the given request object to populate the OWIN standard keys in the environment IDictionary.
Most values are copied so that they can be mutable, but the headers collection is only wrapped.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse">
<summary>
This wraps an HttpListenerResponse, populates it with the given response fields, and relays
the response body to the underlying stream.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse.#ctor(System.Net.HttpListenerContext,Microsoft.Owin.Host.HttpListener.RequestProcessing.CallEnvironment)">
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Owin.Host.HttpListener.RequestProcessing.OwinHttpListenerResponse"/> class.
Sets up the Environment with the necessary request state items.
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Exception_DuplicateKey">
<summary>
Looks up a localized string similar to The key &apos;{0}&apos; is already present in the dictionary..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_AppDisonnectErrors">
<summary>
Looks up a localized string similar to App errors on disconnect notification..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_RequestProcessingException">
<summary>
Looks up a localized string similar to Exception during request processing..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnableToSetup">
<summary>
Looks up a localized string similar to Unable to resolve handles. Disconnect notifications will be ignored..
</summary>
</member>
<member name="P:Microsoft.Owin.Host.HttpListener.Resources.Log_UnexpectedException">
<summary>
Looks up a localized string similar to Unexpected exception..
</summary>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.OwinServerFactory">
<summary>
Implements the Katana setup pattern for the OwinHttpListener server.
</summary>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Initialize(System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Advertise the capabilities of the server.
</summary>
<param name="properties"></param>
</member>
<member name="M:Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(System.Func{System.Collections.Generic.IDictionary{System.String,System.Object},System.Threading.Tasks.Task},System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>
Creates an OwinHttpListener and starts listening on the given URL.
</summary>
<param name="app">The application entry point.</param>
<param name="properties">The addresses to listen on.</param>
<returns>The OwinHttpListener. Invoke Dispose to shut down.</returns>
</member>
<member name="T:Microsoft.Owin.Host.HttpListener.WebSockets.Constants">
<summary>
Standard keys and values for use within the OWIN interfaces
</summary>
</member>
</members>
</doc>

Просмотреть файл

@ -1,22 +1,22 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Microsoft.Owin.Hosting</id>
<version>2.0.2</version>
<title>Microsoft.Owin.Hosting</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_enu.htm</licenseUrl>
<projectUrl>http://katanaproject.codeplex.com/</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Provides default infrastructure types for hosting and running OWIN-based applications.</description>
<releaseNotes />
<copyright />
<language />
<tags>Microsoft OWIN Katana</tags>
<dependencies>
<dependency id="Owin" version="1.0" />
<dependency id="Microsoft.Owin" version="2.0.2" />
</dependencies>
</metadata>
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Microsoft.Owin.Hosting</id>
<version>2.0.2</version>
<title>Microsoft.Owin.Hosting</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_enu.htm</licenseUrl>
<projectUrl>http://katanaproject.codeplex.com/</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Provides default infrastructure types for hosting and running OWIN-based applications.</description>
<releaseNotes />
<copyright />
<language />
<tags>Microsoft OWIN Katana</tags>
<dependencies>
<dependency id="Owin" version="1.0" />
<dependency id="Microsoft.Owin" version="2.0.2" />
</dependencies>
</metadata>
</package>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,18 +1,18 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Newtonsoft.Json</id>
<version>4.5.11</version>
<title>Json.NET</title>
<authors>James Newton-King</authors>
<owners>James Newton-King</owners>
<licenseUrl>http://json.codeplex.com/license</licenseUrl>
<projectUrl>http://james.newtonking.com/projects/json-net.aspx</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Json.NET is a popular high-performance JSON framework for .NET</description>
<releaseNotes />
<copyright />
<language>en-US</language>
<tags>json</tags>
</metadata>
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Newtonsoft.Json</id>
<version>4.5.11</version>
<title>Json.NET</title>
<authors>James Newton-King</authors>
<owners>James Newton-King</owners>
<licenseUrl>http://json.codeplex.com/license</licenseUrl>
<projectUrl>http://james.newtonking.com/projects/json-net.aspx</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Json.NET is a popular high-performance JSON framework for .NET</description>
<releaseNotes />
<copyright />
<language>en-US</language>
<tags>json</tags>
</metadata>
</package>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,15 +1,15 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Owin</id>
<version>1.0</version>
<title>OWIN</title>
<authors>OWIN startup components contributors</authors>
<owners>OWIN startup components contributors</owners>
<licenseUrl>https://github.com/owin-contrib/owin-hosting/blob/master/LICENSE.txt</licenseUrl>
<projectUrl>https://github.com/owin-contrib/owin-hosting/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>OWIN IAppBuilder startup interface</description>
<tags>OWIN</tags>
</metadata>
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Owin</id>
<version>1.0</version>
<title>OWIN</title>
<authors>OWIN startup components contributors</authors>
<owners>OWIN startup components contributors</owners>
<licenseUrl>https://github.com/owin-contrib/owin-hosting/blob/master/LICENSE.txt</licenseUrl>
<projectUrl>https://github.com/owin-contrib/owin-hosting/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>OWIN IAppBuilder startup interface</description>
<tags>OWIN</tags>
</metadata>
</package>

Двоичный файл не отображается.

Просмотреть файл

@ -1,9 +1,34 @@
#include "JobTaskDb.h"
#include "RemotingExecutor.h"
void* MetricThread(void* arg)
{
std::cout << "Start report thread." << std::endl;
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
while (true)
{
std::string metricUri = JobTaskDb::GetInstance().GetMetricReportUri();
if (!metricUri.empty())
{
HandleJson::Metric(metricUri);
}
sleep(Monitoring::Interval);
}
pthread_exit(0);
}
void* ReportingThread(void* arg)
{
while (true)
std::cout << "Start metric thread." << std::endl;
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
while (true)
{
std::string reportUri = JobTaskDb::GetInstance().GetReportUri();
@ -20,16 +45,42 @@ void* ReportingThread(void* arg)
JobTaskDb::JobTaskDb() : executor(new Executor())
{
// start monitoring service
monitoring.Start();
pthread_mutex_init(&jobTaskDbLock, NULL);
this->threadId = new pthread_t();
pthread_create(this->threadId, NULL, ReportingThread, NULL);
pthread_create(&(this->threadId), NULL, ReportingThread, NULL);
pthread_create(&(this->metricThreadId), NULL, MetricThread, NULL);
}
JobTaskDb::~JobTaskDb()
{
if (executor != NULL)
delete executor;
// stop monitoring service
monitoring.Stop();
pthread_mutex_destroy(&jobTaskDbLock);
if (threadId != 0){
pthread_cancel(threadId);
pthread_join(threadId, NULL);
}
if (metricThreadId != 0){
pthread_cancel(metricThreadId);
pthread_join(metricThreadId, NULL);
}
}
void JobTaskDb::SetReportUri(const std::string& reportUri)
{
pthread_mutex_lock(&jobTaskDbLock);
this->reportUri = reportUri;
this->metricReportUri = GetMetricReportUri(this->reportUri);
std::ofstream uriFile("ReportUri", std::ios::trunc);
uriFile << reportUri;
@ -41,15 +92,59 @@ void JobTaskDb::SetReportUri(const std::string& reportUri)
const std::string JobTaskDb::GetReportUri()
{
pthread_mutex_lock(&jobTaskDbLock);
std::string reportUri = this->reportUri;
pthread_mutex_unlock(&jobTaskDbLock);
return this->reportUri;
}
return reportUri;
const std::string JobTaskDb::GetMetricReportUri()
{
return this->metricReportUri;
}
std::string JobTaskDb::GetMetricReportUri(std::string & reportUri)
{
size_t found = reportUri.find_last_of('/');
if (found != std::string::npos){
std::string metricReportUri = reportUri.substr(0, found + 1) + "metricreported";
std::cout << "GetMetricReportUri : " << metricReportUri << std::endl;
return metricReportUri;
}
return "";
}
JobTaskDb* JobTaskDb::instance = NULL;
json::value UMID::GetJson() const
{
json::value obj;
obj[U("MetricId")] = json::value(this->MetricId);
obj[U("InstanceId")] = json::value(this->InstanceId);
return obj;
}
json::value ComputeNodeMetricInformation::GetJson() const
{
json::value obj;
obj[U("Name")] = json::value::string(this->Name);
obj[U("Time")] = json::value::string(this->Time);
std::vector<json::value> arr1;
std::vector<json::value> arr2;
for (std::map<int, UMID*>::const_iterator it = this->Umids.begin();
it != this->Umids.end();
it++)
{
int no = it->first;
arr1.push_back(it->second->GetJson());
arr2.push_back(json::value::number(this->Values.at(no)));
}
obj[U("Umids")] = json::value::array(arr1);
obj[U("Values")] = json::value::array(arr2);
obj[U("TickCount")] = json::value::number(this->TickCount);
return obj;
}
json::value ComputeClusterTaskInformation::GetJson() const
{
json::value obj;
@ -122,6 +217,26 @@ json::value JobTaskDb::GetNodeInfo()
return obj;
}
json::value JobTaskDb::GetMetricInfo()
{
ComputeNodeMetricInformation cnmi(nodeInfo.Name);
// add metric data
UMID cpuUsage(1, 1);
cnmi.Umids[0] = &cpuUsage;
cnmi.Values[0] = monitoring.GetCpuUsage();
UMID memoryUsage(3, 0);
cnmi.Umids[1] = &memoryUsage;
cnmi.Values[1] = monitoring.GetAvailableMemory();
UMID networkUsage(12, 1);
cnmi.Umids[2] = &networkUsage;
cnmi.Values[2] = monitoring.GetNetworkUsage();
json::value obj = cnmi.GetJson();
return obj;
}
void JobTaskDb::StartJobAndTask(int jobId, int taskId, ProcessStartInfo* startInfo, const std::string& callbackUri)
{
std::cout << "Enter StartJobAndTask" << std::endl;

Просмотреть файл

@ -3,11 +3,42 @@
#include "ProcessStartInfo.h"
#include "Executor.h"
#include "Monitoring.h"
#include <syslog.h>
#include <time.h>
class Executor;
struct UMID
{
public:
UMID(unsigned short metricId, unsigned short instanceId)
: MetricId(metricId), InstanceId(instanceId) {}
web::json::value GetJson() const;
unsigned short MetricId;
unsigned short InstanceId;
};
struct ComputeNodeMetricInformation
{
public:
ComputeNodeMetricInformation(std::string nodeName)
: Name(nodeName)
{
time_t t;
time(&t);
Time = ctime(&t);
TickCount = Monitoring::Interval;
}
web::json::value GetJson() const;
std::string Name;
std::string Time;
std::map<int, UMID*> Umids;
std::map<int, float> Values;
int TickCount;
};
struct ComputeClusterTaskInformation
{
public:
@ -74,6 +105,7 @@ class JobTaskDb
// Not acquiring locks for singleton. We can initialize in the very beginning.
static void Initialize()
{
std::cout << "JobTaskDb : Initializing" << std::endl;
instance = new JobTaskDb();
char nodeName[256];
@ -93,6 +125,8 @@ class JobTaskDb
if (uriFile)
{
uriFile >> instance->reportUri;
instance->metricReportUri = instance->GetMetricReportUri(instance->reportUri);
std::cout << "Loaded Report Uri: " << instance->reportUri << std::endl;
}
else
@ -102,6 +136,7 @@ class JobTaskDb
}
web::json::value GetNodeInfo();
web::json::value GetMetricInfo();
web::json::value GetTaskInfo(int jobId, int taskId) const;
void StartJobAndTask(int jobId, int taskId, ProcessStartInfo* startInfo, const std::string& callbackUri);
void EndJob(int jobId);
@ -109,20 +144,26 @@ class JobTaskDb
void RemoveTask(int jobId, int taskId);
void SetReportUri(const std::string& reportUri);
const std::string GetReportUri();
const std::string GetMetricReportUri();
std::string GetMetricReportUri(std::string & reportUri);
protected:
private:
JobTaskDb();
JobTaskDb();
~JobTaskDb();
void Callback(std::string callbackUri, web::json::value callbackBody);
static JobTaskDb* instance;
pthread_mutex_t jobTaskDbLock;
pthread_t *threadId;
pthread_t threadId;
pthread_t metricThreadId;
std::string reportUri;
std::string metricReportUri;
ComputeClusterNodeInformation nodeInfo;
Executor* executor;
Monitoring monitoring;
};
#endif // JOBTASKDB_H

Просмотреть файл

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{EA48B422-D51D-42D8-950D-38860819B473}</ProjectGuid>
<RootNamespace>LinuxNodeMgr</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Executor.cpp" />
<ClCompile Include="JobTaskDb.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="Monitoring.cpp" />
<ClCompile Include="ProcessStartInfo.cpp" />
<ClCompile Include="RemotingCommunicator.cpp" />
<ClCompile Include="RemotingExecutor.cpp" />
<ClCompile Include="UnionFindSet.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Executor.h" />
<ClInclude Include="JobTaskDb.h" />
<ClInclude Include="Monitoring.h" />
<ClInclude Include="ProcessStartInfo.h" />
<ClInclude Include="RemotingCommunicator.h" />
<ClInclude Include="RemotingExecutor.h" />
<ClInclude Include="UnionFindSet.h" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

Просмотреть файл

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Executor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="JobTaskDb.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ProcessStartInfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RemotingCommunicator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RemotingExecutor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="UnionFindSet.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Monitoring.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Executor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="JobTaskDb.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ProcessStartInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RemotingCommunicator.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RemotingExecutor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="UnionFindSet.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Monitoring.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="Makefile" />
</ItemGroup>
</Project>

Просмотреть файл

@ -40,9 +40,9 @@ OBJDIR_RELEASE = obj/Release
DEP_RELEASE =
OUT_RELEASE = bin/Release/NM
OBJ_DEBUG = $(OBJDIR_DEBUG)/Executor.o $(OBJDIR_DEBUG)/JobTaskDb.o $(OBJDIR_DEBUG)/ProcessStartInfo.o $(OBJDIR_DEBUG)/RemotingCommunicator.o $(OBJDIR_DEBUG)/RemotingExecutor.o $(OBJDIR_DEBUG)/UnionFindSet.o $(OBJDIR_DEBUG)/main.o
OBJ_DEBUG = $(OBJDIR_DEBUG)/Executor.o $(OBJDIR_DEBUG)/JobTaskDb.o $(OBJDIR_DEBUG)/ProcessStartInfo.o $(OBJDIR_DEBUG)/RemotingCommunicator.o $(OBJDIR_DEBUG)/RemotingExecutor.o $(OBJDIR_DEBUG)/UnionFindSet.o $(OBJDIR_DEBUG)/main.o $(OBJDIR_DEBUG)/Monitoring.o
OBJ_RELEASE = $(OBJDIR_RELEASE)/Executor.o $(OBJDIR_RELEASE)/JobTaskDb.o $(OBJDIR_RELEASE)/ProcessStartInfo.o $(OBJDIR_RELEASE)/RemotingCommunicator.o $(OBJDIR_RELEASE)/RemotingExecutor.o $(OBJDIR_RELEASE)/UnionFindSet.o $(OBJDIR_RELEASE)/main.o
OBJ_RELEASE = $(OBJDIR_RELEASE)/Executor.o $(OBJDIR_RELEASE)/JobTaskDb.o $(OBJDIR_RELEASE)/ProcessStartInfo.o $(OBJDIR_RELEASE)/RemotingCommunicator.o $(OBJDIR_RELEASE)/RemotingExecutor.o $(OBJDIR_RELEASE)/UnionFindSet.o $(OBJDIR_RELEASE)/main.o $(OBJDIR_RELEASE)/Monitoring.o
all: debug release
@ -80,6 +80,9 @@ $(OBJDIR_DEBUG)/UnionFindSet.o: UnionFindSet.cpp
$(OBJDIR_DEBUG)/main.o: main.cpp
$(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c main.cpp -o $(OBJDIR_DEBUG)/main.o
$(OBJDIR_DEBUG)/Monitoring.o: Monitoring.cpp
$(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c Monitoring.cpp -o $(OBJDIR_DEBUG)/Monitoring.o
clean_debug:
rm -f $(OBJ_DEBUG) $(OUT_DEBUG)
rm -rf bin/Debug
@ -117,6 +120,9 @@ $(OBJDIR_RELEASE)/UnionFindSet.o: UnionFindSet.cpp
$(OBJDIR_RELEASE)/main.o: main.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c main.cpp -o $(OBJDIR_RELEASE)/main.o
$(OBJDIR_RELEASE)/Monitoring.o: Monitoring.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Monitoring.cpp -o $(OBJDIR_RELEASE)/Monitoring.o
clean_release:
rm -f $(OBJ_RELEASE) $(OUT_RELEASE)
rm -rf bin/Release

176
LinuxNodeMgr/Monitoring.cpp Normal file
Просмотреть файл

@ -0,0 +1,176 @@
#include "Monitoring.h"
void * MonitoringThread(void* param){
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
Monitoring * m = (Monitoring *)param;
m->Run();
return NULL;
}
Monitoring::Monitoring()
{
pthread_mutex_init(&_lock, NULL);
_cpuUsage = 0.0F;
_availableMemory = 0.0F;
_networkUsage = 0.0F;
_cpuTotal = 0;
_cpuIdle = 0;
_network = 0;
}
Monitoring::~Monitoring()
{
Stop();
}
void Monitoring::Start()
{
int ret = pthread_create(&_threadId, NULL, MonitoringThread, (void *)this);
if (ret != 0){
cout << "Failed to start Monitoring thread!" << endl;
}
}
void Monitoring::Stop()
{
if (_threadId != 0){
pthread_cancel(_threadId);
pthread_join(_threadId, NULL);
}
}
float Monitoring::GetCpuUsage()
{
return _cpuUsage;
}
float Monitoring::GetAvailableMemory()
{
return _availableMemory;
}
float Monitoring::GetNetworkUsage()
{
return _networkUsage;
}
void Monitoring::Run()
{
long int cputotal = 0, cpuidle = 0, memory = 0, network = 0;
while (true){
// get cpu usage
cputotal = 0;
cpuidle = 0;
getCpuUsage(cputotal, cpuidle);
_cpuUsage = (float)((cputotal - _cpuTotal) - (cpuidle - _cpuIdle)) / (cputotal - _cpuTotal) * 100.0F;
_cpuTotal = cputotal;
_cpuIdle = cpuidle;
// get memory usage
memory = 0;
getAvailableMemory(memory);
_availableMemory = (float)memory / 1024.0F; // K -> M
// get network speed
network = 0;
getNetworkUsage(network);
_networkUsage = (float)(network - _network) / Monitoring::Interval;
_network = network;
// wait a little time
// cout << "Monitoring : " << _cpuUsage << " " << _availableMemory << " " << _networkUsage << endl;
sleep(Interval);
}
}
void Monitoring::getCpuUsage(long int & cputotal, long int & cpuidle)
{
char * ret = NULL;
char buf[256];
char cpu[5];
long int user, nice, sys, idle, iowait, irq, softirq;
FILE * fp = fopen("/proc/stat", "r");
if (fp == NULL)
{
cputotal = 0;
cpuidle = 0;
return;
}
ret = fgets(buf, sizeof(buf), fp);
if (ret) {
sscanf(buf, "%s%ld%ld%ld%ld%ld%ld%ld", cpu, &user, &nice, &sys, &idle, &iowait, &irq, &softirq);
}
fclose(fp);
cputotal = user + nice + sys + idle + iowait + irq + softirq;
cpuidle = idle;
return;
}
void Monitoring::getAvailableMemory(long int & memory)
{
char * ret = NULL;
char buf[256];
char name[20];
char unit[20];
long int free;
FILE * fp = fopen("/proc/meminfo", "r");
if (fp == NULL)
{
memory = 0;
return;
}
ret = fgets(buf, sizeof(buf), fp);
ret = fgets(buf, sizeof(buf), fp);
if (ret) {
sscanf(buf, "%s%ld%s", name, &free, unit);
}
fclose(fp);
memory = free;
return;
}
void Monitoring::getNetworkUsage(long int & network)
{
char * ret = NULL;
char buf[256];
char name[20];
long int receive, send, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9, tmp10, tmp11, tmp12, tmp13, tmp14;
FILE * fp = fopen("/proc/net/dev", "r");
if (fp == NULL)
{
network = 0;
return;
}
ret = fgets(buf, sizeof(buf), fp);
ret = fgets(buf, sizeof(buf), fp);
ret = fgets(buf, sizeof(buf), fp);
if (ret) {
sscanf(buf, "%s%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld", name, &receive, &tmp1, &tmp2, &tmp3, &tmp4, &tmp5, &tmp6, &tmp7, &send, &tmp8, &tmp9, &tmp10, &tmp11, &tmp12, &tmp13, &tmp14);
}
fclose(fp);
network = receive + send;
return;
}

47
LinuxNodeMgr/Monitoring.h Normal file
Просмотреть файл

@ -0,0 +1,47 @@
#ifndef MONITORING_H
#define MONITORING_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <pthread.h>
#include <unistd.h>
using namespace std;
class Monitoring
{
public:
static const int Interval = 2;
Monitoring();
~Monitoring();
void Start();
void Stop();
void Run();
float GetCpuUsage();
float GetAvailableMemory();
float GetNetworkUsage();
private:
void getCpuUsage(long int & cputotal, long int & cpuidle);
long int _cpuTotal;
long int _cpuIdle;
void getAvailableMemory(long int & memory);
void getNetworkUsage(long int & network);
long int _network;
pthread_t _threadId;
pthread_mutex_t _lock;
float _cpuUsage;
float _availableMemory;
float _networkUsage;
};
#endif // MONITORING_H

Просмотреть файл

@ -90,14 +90,14 @@ std::string ProcessStartInfo::GetCommandScript()
char scriptPath[256];
strcpy(scriptPath, "/tmp/run.XXXXXX");
/* Make temp file */
if (mkstemp(scriptPath) < 0)
{
return "";
}
else
{
std::cout << "Script temp file name: " << scriptPath << std::endl;
/* Make temp file */
if (mkstemp(scriptPath) < 0)
{
return "";
}
else
{
std::cout << "Script temp file name: " << scriptPath << std::endl;
}
commandScript = scriptPath;

Просмотреть файл

@ -46,8 +46,9 @@ void HandleJson::Ping(std::string callBackUri)
web::http::http_request request;
request.set_method(http::methods::POST);
std::string body = JobTaskDb::GetInstance().GetNodeInfo().serialize();
std::cout << "Reported to " << callBackUri << std::endl;
std::cout << "Body: " << body << std::endl;
//std::cout << "Reported to " << callBackUri << std::endl;
//std::cout << "Body: " << body << std::endl;
request.set_body(body, U("application/json"));
client.request(request).then([](pplx::task<web::http::http_response> t)
@ -56,6 +57,23 @@ void HandleJson::Ping(std::string callBackUri)
});
}
void HandleJson::Metric(std::string callBackUri)
{
web::http::client::http_client client(U(callBackUri));
web::http::http_request request;
request.set_method(http::methods::POST);
std::string body = JobTaskDb::GetInstance().GetMetricInfo().serialize();
//std::cout << "Reported to " << callBackUri << std::endl;
//std::cout << "Body: " << body << std::endl;
request.set_body(body, U("application/json"));
client.request(request).then([](pplx::task<web::http::http_response> t)
{
HandleError(t);
});
}
template<typename T>
void HandleJson::HandleError(pplx::task<T>& t)
{

Просмотреть файл

@ -26,6 +26,9 @@ namespace HandleJson
/// Ping
void Ping(std::string);
/// Metric
void Metric(std::string);
template<typename T>
void HandleError(pplx::task<T>& t);
};

Просмотреть файл

@ -134,8 +134,8 @@ int main()
std::cout << sourceAddress << std::endl;
// syslog(LOG_INFO, sourceAddress.c_str());
KillZombie();
JobTaskDb::Initialize();
KillZombie();
JobTaskDb::Initialize();
RemotingCommunicator rc(sourceAddress);
rc.OpenListener();
@ -152,3 +152,4 @@ int main()
return 0;
}