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

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

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

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

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

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

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

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

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

@ -1,50 +1,75 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web.Http; using System.Web.Http;
using Microsoft.Hpc.Activation; using Microsoft.Hpc.Activation;
using Microsoft.Hpc.Scheduler.Communicator; using Microsoft.Hpc.Scheduler.Communicator;
using Microsoft.Hpc.Communicators.LinuxCommunicator.Monitoring;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{ namespace Microsoft.Hpc.Communicators.LinuxCommunicator
public class CallbackController : ApiController {
{ public class CallbackController : ApiController
[HttpPost] {
[Route("api/{nodename}/computenodereported")] [HttpPost]
public int ComputeNodeReported(string nodeName, [FromBody] ComputeClusterNodeInformation nodeInfo) [Route("api/{nodename}/computenodereported")]
{ public int ComputeNodeReported(string nodeName, [FromBody] ComputeClusterNodeInformation nodeInfo)
try {
{ try
var arg = new ComputeNodeInfoEventArg(nodeInfo.Name, nodeInfo); {
LinuxCommunicator.Instance.Tracer.TraceInfo("Linux ComputeNodeReported. NodeName {0}, JobCount {1}", arg.NodeName, arg.NodeInfo.Jobs.Count); var arg = new ComputeNodeInfoEventArg(nodeInfo.Name, nodeInfo);
int nextPing = LinuxCommunicator.Instance.Listener.ComputeNodeReported(arg); 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;
} return nextPing;
catch (Exception ex) }
{ catch (Exception ex)
LinuxCommunicator.Instance.Tracer.TraceException(ex); {
} LinuxCommunicator.Instance.Tracer.TraceException(ex);
}
return 5000;
} return 5000;
}
[HttpPost]
[Route("api/{nodename}/taskcompleted")] [HttpPost]
public NextOperation TaskCompleted(string nodeName, [FromBody] ComputeNodeTaskCompletionEventArg taskInfo) [Route("api/{nodename}/taskcompleted")]
{ public NextOperation TaskCompleted(string nodeName, [FromBody] ComputeNodeTaskCompletionEventArg taskInfo)
try {
{ try
LinuxCommunicator.Instance.Tracer.TraceInfo("Linux TaskCompleted. NodeName {0}, TaskMessage {1}", taskInfo.NodeName, taskInfo.TaskInfo.Message); {
return LinuxCommunicator.Instance.Listener.TaskCompleted(taskInfo); LinuxCommunicator.Instance.Tracer.TraceInfo("Linux TaskCompleted. NodeName {0}, TaskMessage {1}", taskInfo.NodeName, taskInfo.TaskInfo.Message);
} return LinuxCommunicator.Instance.Listener.TaskCompleted(taskInfo);
catch (Exception ex) }
{ catch (Exception ex)
LinuxCommunicator.Instance.Tracer.TraceException(ex); {
return NextOperation.CancelJob; 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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Net.Http.Formatting; using System.Net.Http.Formatting;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Hpc.Activation; using Microsoft.Hpc.Activation;
using Microsoft.Hpc.Scheduler.Communicator; using Microsoft.Hpc.Scheduler;
using Microsoft.Hpc.Scheduler.Communicator;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator using System.Net;
{
public class LinuxCommunicator : IUnmanagedResourceCommunicator, IDisposable namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{ {
private const string ResourceUriFormat = "http://{0}:50001/api/{1}/{2}"; public class LinuxCommunicator : IUnmanagedResourceCommunicator, IDisposable
private const string CallbackUriHeaderName = "CallbackUri"; {
private const string ResourceUriFormat = "http://{0}:50001/api/{1}/{2}";
private HttpClient client; private const string CallbackUriHeaderName = "CallbackUri";
private WebServer server; private const string HpcFullKeyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HPC";
private const string ClusterNameKeyName = "ClusterName";
private CancellationTokenSource cancellationTokenSource;
private readonly string HeadNode = (string)Microsoft.Win32.Registry.GetValue(HpcFullKeyName, ClusterNameKeyName, null);
private static LinuxCommunicator instance; private readonly int MonitoringPort = 9894;
public LinuxCommunicator() private HttpClient client;
{ private WebServer server;
if (instance != null) private Monitoring.CounterDataSender sender;
{ private Dictionary<string, Guid> nodeMap;
throw new InvalidOperationException("An instance of LinuxCommunicator already exists.");
} private CancellationTokenSource cancellationTokenSource;
instance = this; private static LinuxCommunicator instance;
}
public LinuxCommunicator()
public void Dispose() {
{ if (instance != null)
this.server.Dispose(); {
this.client.Dispose(); throw new InvalidOperationException("An instance of LinuxCommunicator already exists.");
GC.SuppressFinalize(this); }
}
instance = this;
public static LinuxCommunicator Instance }
{
get { return instance; } public void Dispose()
} {
this.sender.CloseConnection();
public string LinuxServiceHost this.server.Dispose();
{ this.client.Dispose();
get; GC.SuppressFinalize(this);
set; }
}
public static LinuxCommunicator Instance
public INodeCommTracing Tracer {
{ get { return instance; }
get; }
private set;
} public string LinuxServiceHost
{
public ISchedulerCallbacks Listener get;
{ set;
get; }
private set;
} public INodeCommTracing Tracer
{
public string NodeGroupName { get { return "LinuxNodes"; } } get;
private set;
public void Accept(ISchedulerCallbacks listener) { this.Listener = listener; } }
public void SetTracer(INodeCommTracing tracer) public ISchedulerCallbacks Listener
{ {
this.Tracer = tracer; get;
} private set;
}
public bool Initialize()
{ public string NodeGroupName { get { return "LinuxNodes"; } }
this.Tracer.TraceInfo("Initializing LinuxCommunicator.");
this.client = new HttpClient(); public void Accept(ISchedulerCallbacks listener) { this.Listener = listener; }
this.server = new WebServer();
public void SetTracer(INodeCommTracing tracer)
this.Tracer.TraceInfo("Initialized LinuxCommunicator."); {
return true; this.Tracer = tracer;
} }
public bool Start() public bool Initialize()
{ {
this.Tracer.TraceInfo("Starting LinuxCommunicator."); this.Tracer.TraceInfo("Initializing LinuxCommunicator.");
this.cancellationTokenSource = new CancellationTokenSource(); this.client = new HttpClient();
this.server.Start().Wait(); this.server = new WebServer();
return true; if (this.HeadNode == null)
} {
ArgumentNullException exp = new ArgumentNullException(ClusterNameKeyName);
public bool Stop() Tracer.TraceError("Failed to find registry value: {0}. {1}", ClusterNameKeyName, exp);
{ throw exp;
this.Tracer.TraceInfo("Stopping LinuxCommunicator."); }
this.server.Stop();
this.cancellationTokenSource.Cancel(); this.sender = new Monitoring.CounterDataSender();
this.cancellationTokenSource.Dispose(); this.sender.OpenConnection(this.HeadNode, this.MonitoringPort);
this.cancellationTokenSource = null;
return true; IScheduler scheduler = new Scheduler.Scheduler();
} scheduler.Connect(this.HeadNode);
this.nodeMap = new Dictionary<string, Guid>();
public void OnNodeStatusChange(string nodeName, bool reachable) foreach (ISchedulerNode node in scheduler.GetNodeList(null, null))
{ {
} this.nodeMap.Add(node.Name.ToLower(), node.Guid);
}
public void EndJob(string nodeName, EndJobArg arg, NodeCommunicatorCallBack<EndJobArg> callback) scheduler.Close();
{
this.SendRequest("endjob", "taskcompleted", nodeName, callback, arg); this.Tracer.TraceInfo("Initialized LinuxCommunicator.");
} return true;
}
public void EndTask(string nodeName, EndTaskArg arg, NodeCommunicatorCallBack<EndTaskArg> callback)
{ public bool Start()
this.SendRequest("endtask", "taskcompleted", nodeName, callback, arg); {
} this.Tracer.TraceInfo("Starting LinuxCommunicator.");
this.cancellationTokenSource = new CancellationTokenSource();
public void StartJobAndTask(string nodeName, StartJobAndTaskArg arg, string userName, string password, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartJobAndTaskArg> callback) this.server.Start().Wait();
{
this.SendRequest("startjobandtask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo)); return true;
} }
public void StartJobAndTaskSoftCardCred(string nodeName, StartJobAndTaskArg arg, string userName, string password, byte[] certificate, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartJobAndTaskArg> callback) public bool Stop()
{ {
this.SendRequest("startjobandtask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo)); this.Tracer.TraceInfo("Stopping LinuxCommunicator.");
} this.server.Stop();
this.cancellationTokenSource.Cancel();
public void StartTask(string nodeName, StartTaskArg arg, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartTaskArg> callback) this.cancellationTokenSource.Dispose();
{ this.cancellationTokenSource = null;
this.SendRequest("starttask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo)); return true;
} }
public void Ping(string nodeName) public void OnNodeStatusChange(string nodeName, bool reachable)
{ {
this.SendRequest<NodeCommunicatorCallBackArg>("ping", "computenodereported", nodeName, (name, arg, ex) => }
{
this.Tracer.TraceInfo("Compute node {0} pinged. Ex {1}", name, ex); public void EndJob(string nodeName, EndJobArg arg, NodeCommunicatorCallBack<EndJobArg> callback)
}, null); {
} this.SendRequest("endjob", "taskcompleted", nodeName, callback, arg);
}
private void SendRequest<T>(string action, string callbackAction, string nodeName, NodeCommunicatorCallBack<T> callback, T arg) where T : NodeCommunicatorCallBackArg
{ public void EndTask(string nodeName, EndTaskArg arg, NodeCommunicatorCallBack<EndTaskArg> callback)
var request = new HttpRequestMessage(HttpMethod.Post, this.GetResoureUri(nodeName, action)); {
request.Headers.Add(CallbackUriHeaderName, this.GetCallbackUri(nodeName, callbackAction)); this.SendRequest("endtask", "taskcompleted", nodeName, callback, arg);
var formatter = new JsonMediaTypeFormatter(); }
request.Content = new ObjectContent<T>(arg, formatter);
public void StartJobAndTask(string nodeName, StartJobAndTaskArg arg, string userName, string password, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartJobAndTaskArg> callback)
this.client.SendAsync(request, this.cancellationTokenSource.Token).ContinueWith(t => {
{ this.SendRequest("startjobandtask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo));
Exception ex = t.Exception; }
if (ex == null) public void StartJobAndTaskSoftCardCred(string nodeName, StartJobAndTaskArg arg, string userName, string password, byte[] certificate, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartJobAndTaskArg> callback)
{ {
try this.SendRequest("startjobandtask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo));
{ }
t.Result.EnsureSuccessStatusCode();
} public void StartTask(string nodeName, StartTaskArg arg, ProcessStartInfo startInfo, NodeCommunicatorCallBack<StartTaskArg> callback)
catch (Exception e) {
{ this.SendRequest("starttask", "taskcompleted", nodeName, callback, Tuple.Create(arg, startInfo));
ex = e; }
}
} public void Ping(string nodeName)
{
callback(nodeName, arg, ex); this.SendRequest<NodeCommunicatorCallBackArg>("ping", "computenodereported", nodeName, (name, arg, ex) =>
}, this.cancellationTokenSource.Token); {
} this.Tracer.TraceInfo("Compute node {0} pinged. Ex {1}", name, ex);
}, null);
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)); private void SendRequest<T>(string action, string callbackAction, string nodeName, NodeCommunicatorCallBack<T> callback, T arg) where T : NodeCommunicatorCallBackArg
request.Headers.Add(CallbackUriHeaderName, this.GetCallbackUri(nodeName, callbackAction)); {
var formatter = new JsonMediaTypeFormatter(); var request = new HttpRequestMessage(HttpMethod.Post, this.GetResoureUri(nodeName, action));
request.Content = new ObjectContent<Tuple<T, T1>>(arg, formatter); request.Headers.Add(CallbackUriHeaderName, this.GetCallbackUri(nodeName, callbackAction));
var formatter = new JsonMediaTypeFormatter();
this.client.SendAsync(request, this.cancellationTokenSource.Token).ContinueWith(t => request.Content = new ObjectContent<T>(arg, formatter);
{
Exception ex = t.Exception; this.client.SendAsync(request, this.cancellationTokenSource.Token).ContinueWith(t =>
{
if (ex == null) Exception ex = t.Exception;
{
try if (ex == null)
{ {
t.Result.EnsureSuccessStatusCode(); try
} {
catch (Exception e) t.Result.EnsureSuccessStatusCode();
{ }
ex = e; catch (Exception e)
} {
} ex = e;
}
callback(nodeName, arg.Item1, ex); }
}, this.cancellationTokenSource.Token);
} callback(nodeName, arg, ex);
}, this.cancellationTokenSource.Token);
private Uri GetResoureUri(string nodeName, string action) }
{
var hostName = this.LinuxServiceHost ?? nodeName; private void SendRequest<T, T1>(string action, string callbackAction, string nodeName, NodeCommunicatorCallBack<T> callback, Tuple<T, T1> arg) where T : NodeCommunicatorCallBackArg
return new Uri(string.Format(ResourceUriFormat, hostName, nodeName, action)); {
//if (hostName.Contains(".")) var request = new HttpRequestMessage(HttpMethod.Post, this.GetResoureUri(nodeName, action));
//{ request.Headers.Add(CallbackUriHeaderName, this.GetCallbackUri(nodeName, callbackAction));
// return new Uri(string.Format(ResourceUriFormat, hostName, nodeName, action)); var formatter = new JsonMediaTypeFormatter();
//} request.Content = new ObjectContent<Tuple<T, T1>>(arg, formatter);
//else
//{ this.client.SendAsync(request, this.cancellationTokenSource.Token).ContinueWith(t =>
// return new Uri(string.Format(ResourceUriWithDomainFormat, hostName, nodeName, action)); ; {
//} Exception ex = t.Exception;
}
if (ex == null)
private string GetCallbackUri(string nodeName, string action) {
{ try
// var callbackUri = "http://10.0.0.4:50000/api/{1}/{2}"; {
t.Result.EnsureSuccessStatusCode();
return string.Format("{0}/api/{1}/{2}", this.server.ListeningUri, nodeName, action); }
} 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"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <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')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AA00383C-5CAA-47E2-AAAF-04AE2890B534}</ProjectGuid> <ProjectGuid>{AA00383C-5CAA-47E2-AAAF-04AE2890B534}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Hpc.Communicators.LinuxCommunicator</RootNamespace> <RootNamespace>Microsoft.Hpc.Communicators.LinuxCommunicator</RootNamespace>
<AssemblyName>Microsoft.Hpc.Communicators.LinuxCommunicator</AssemblyName> <AssemblyName>Microsoft.Hpc.Communicators.LinuxCommunicator</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CcpActivate, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="CcpActivate, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>ref\CcpActivate.dll</HintPath> <HintPath>ref\CcpActivate.dll</HintPath>
</Reference> <Private>False</Private>
<Reference Include="Microsoft.Hpc.Scheduler.Communicator, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL"> </Reference>
<SpecificVersion>False</SpecificVersion> <Reference Include="Microsoft.Hpc.Scheduler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>ref\Microsoft.Hpc.Scheduler.Communicator.dll</HintPath> <SpecificVersion>False</SpecificVersion>
</Reference> <HintPath>ref\Microsoft.Hpc.Scheduler.dll</HintPath>
<Reference Include="Microsoft.Owin"> </Reference>
<HintPath>..\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll</HintPath> <Reference Include="Microsoft.Hpc.Scheduler.Communicator, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
</Reference> <SpecificVersion>False</SpecificVersion>
<Reference Include="Microsoft.Owin.Host.HttpListener"> <HintPath>ref\Microsoft.Hpc.Scheduler.Communicator.dll</HintPath>
<HintPath>..\packages\Microsoft.Owin.Host.HttpListener.2.0.2\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Microsoft.Owin.Hosting"> <Reference Include="Microsoft.Owin">
<HintPath>..\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll</HintPath> <HintPath>..\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Microsoft.Owin.Host.HttpListener">
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Microsoft.Owin.Host.HttpListener.2.0.2\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath>
</Reference> </Reference>
<Reference Include="Owin"> <Reference Include="Microsoft.Owin.Hosting">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> <HintPath>..\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<Reference Include="System.Core" /> <HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
<Reference Include="System.Net.Http" /> </Reference>
<Reference Include="System.Net.Http.Formatting, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Owin">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.0\lib\net45\System.Net.Http.Formatting.dll</HintPath> </Reference>
</Reference> <Reference Include="System" />
<Reference Include="System.Web.Http, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Core" />
<SpecificVersion>False</SpecificVersion> <Reference Include="System.Net.Http" />
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.0\lib\net45\System.Web.Http.dll</HintPath> <Reference Include="System.Net.Http.Formatting, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
</Reference> <SpecificVersion>False</SpecificVersion>
<Reference Include="System.Web.Http.Owin"> <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Owin.5.2.0\lib\net45\System.Web.Http.Owin.dll</HintPath> </Reference>
</Reference> <Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Web.Http, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Data.DataSetExtensions" /> <SpecificVersion>False</SpecificVersion>
<Reference Include="Microsoft.CSharp" /> <HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.0\lib\net45\System.Web.Http.dll</HintPath>
<Reference Include="System.Data" /> </Reference>
<Reference Include="System.Xml" /> <Reference Include="System.Web.Http.Owin">
</ItemGroup> <HintPath>..\packages\Microsoft.AspNet.WebApi.Owin.5.2.0\lib\net45\System.Web.Http.Owin.dll</HintPath>
<ItemGroup> </Reference>
<Compile Include="CallbackController.cs" /> <Reference Include="System.Xml.Linq" />
<Compile Include="LinuxCommunicator.cs" /> <Reference Include="System.Data.DataSetExtensions" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Reference Include="Microsoft.CSharp" />
<Compile Include="Startup.cs" /> <Reference Include="System.Data" />
<Compile Include="TaskExtensionMethods.cs" /> <Reference Include="System.Xml" />
<Compile Include="WebServer.cs" /> </ItemGroup>
</ItemGroup> <ItemGroup>
<ItemGroup> <Compile Include="CallbackController.cs" />
<None Include="packages.config" /> <Compile Include="LinuxCommunicator.cs" />
</ItemGroup> <Compile Include="Monitoring\ComputeNodeMetricInformation.cs" />
<ItemGroup> <Compile Include="Monitoring\MonitoringPacket.cs" />
<WCFMetadata Include="Service References\" /> <Compile Include="Monitoring\MonitoringStoreInterface.cs" />
</ItemGroup> <Compile Include="Monitoring\UDPClient.cs" />
<ItemGroup> <Compile Include="Properties\AssemblyInfo.cs" />
<Content Include="deploy.txt" /> <Compile Include="Startup.cs" />
</ItemGroup> <Compile Include="TaskExtensionMethods.cs" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Compile Include="WebServer.cs" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. </ItemGroup>
Other similar extension points exist, see Microsoft.Common.targets. <ItemGroup>
<Target Name="BeforeBuild"> <None Include="packages.config" />
</Target> </ItemGroup>
<Target Name="AfterBuild"> <ItemGroup>
</Target> <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> </Project>

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

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

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

@ -5,6 +5,12 @@ VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinuxCommunicator", "LinuxCommunicator.csproj", "{AA00383C-5CAA-47E2-AAAF-04AE2890B534}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinuxCommunicator", "LinuxCommunicator.csproj", "{AA00383C-5CAA-47E2-AAAF-04AE2890B534}"
EndProject 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 Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU 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.ActiveCfg = Release|Any CPU
{AA00383C-5CAA-47E2-AAAF-04AE2890B534}.Release|Mixed Platforms.Build.0 = 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 {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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE 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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web.Http; using System.Web.Http;
using Owin; using Owin;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{ {
public class Startup public class Startup
{ {
public void Configuration(IAppBuilder appBuilder) public void Configuration(IAppBuilder appBuilder)
{ {
var config = new HttpConfiguration(); var config = new HttpConfiguration();
// Web API configuration and services // Web API configuration and services
// Web API routes // Web API routes
config.MapHttpAttributeRoutes(); config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute( config.Routes.MapHttpRoute(
name: "DefaultApi", name: "DefaultApi",
routeTemplate: "api/{controller}/{id}", routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional } defaults: new { id = RouteParameter.Optional }
); );
appBuilder.UseWebApi(config); 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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.Hpc.Communicators.LinuxCommunicator namespace Microsoft.Hpc.Communicators.LinuxCommunicator
{ {
public static class TaskExtensionMethods public static class TaskExtensionMethods
{ {
public static void StartAndForget(this Task task) public static void StartAndForget(this Task task)
{ {
// Do nothing // Do nothing
} }
} }
} }

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

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

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

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

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

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

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

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

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

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

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

@ -1,22 +1,22 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>Microsoft.AspNet.WebApi.Core</id> <id>Microsoft.AspNet.WebApi.Core</id>
<version>5.2.0</version> <version>5.2.0</version>
<title>Microsoft ASP.NET Web API 2.2 Core Libraries</title> <title>Microsoft ASP.NET Web API 2.2 Core Libraries</title>
<authors>Microsoft</authors> <authors>Microsoft</authors>
<owners>Microsoft</owners> <owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl> <licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
<projectUrl>http://www.asp.net/web-api</projectUrl> <projectUrl>http://www.asp.net/web-api</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance> <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> <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> <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> <releaseNotes>Please visit http://go.microsoft.com/fwlink/?LinkID=403010 to view the release notes.</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright> <copyright>© Microsoft Corporation. All rights reserved.</copyright>
<language>en-US</language> <language>en-US</language>
<tags>Microsoft AspNet WebApi AspNetWebApi</tags> <tags>Microsoft AspNet WebApi AspNetWebApi</tags>
<dependencies> <dependencies>
<dependency id="Microsoft.AspNet.WebApi.Client" version="5.2.0" /> <dependency id="Microsoft.AspNet.WebApi.Client" version="5.2.0" />
</dependencies> </dependencies>
</metadata> </metadata>
</package> </package>

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

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

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

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

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

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

@ -1,24 +1,24 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>Microsoft.AspNet.WebApi.OwinSelfHost</id> <id>Microsoft.AspNet.WebApi.OwinSelfHost</id>
<version>5.2.0</version> <version>5.2.0</version>
<title>Microsoft ASP.NET Web API 2.2 OWIN Self Host</title> <title>Microsoft ASP.NET Web API 2.2 OWIN Self Host</title>
<authors>Microsoft</authors> <authors>Microsoft</authors>
<owners>Microsoft</owners> <owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl> <licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
<projectUrl>http://www.asp.net/web-api</projectUrl> <projectUrl>http://www.asp.net/web-api</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance> <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> <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> <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> <releaseNotes>Please visit http://go.microsoft.com/fwlink/?LinkID=403010 to view the release notes.</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright> <copyright>© Microsoft Corporation. All rights reserved.</copyright>
<language>en-US</language> <language>en-US</language>
<tags>Microsoft AspNet WebApi AspNetWebApi OWIN</tags> <tags>Microsoft AspNet WebApi AspNetWebApi OWIN</tags>
<dependencies> <dependencies>
<dependency id="Microsoft.AspNet.WebApi.Owin" version="[5.2.0, 5.3.0)" /> <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.Hosting" version="2.0.2" />
<dependency id="Microsoft.Owin.Host.HttpListener" version="2.0.2" /> <dependency id="Microsoft.Owin.Host.HttpListener" version="2.0.2" />
</dependencies> </dependencies>
</metadata> </metadata>
</package> </package>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,9 +1,34 @@
#include "JobTaskDb.h" #include "JobTaskDb.h"
#include "RemotingExecutor.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) 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(); std::string reportUri = JobTaskDb::GetInstance().GetReportUri();
@ -20,16 +45,42 @@ void* ReportingThread(void* arg)
JobTaskDb::JobTaskDb() : executor(new Executor()) JobTaskDb::JobTaskDb() : executor(new Executor())
{ {
// start monitoring service
monitoring.Start();
pthread_mutex_init(&jobTaskDbLock, NULL); 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) void JobTaskDb::SetReportUri(const std::string& reportUri)
{ {
pthread_mutex_lock(&jobTaskDbLock); pthread_mutex_lock(&jobTaskDbLock);
this->reportUri = reportUri; this->reportUri = reportUri;
this->metricReportUri = GetMetricReportUri(this->reportUri);
std::ofstream uriFile("ReportUri", std::ios::trunc); std::ofstream uriFile("ReportUri", std::ios::trunc);
uriFile << reportUri; uriFile << reportUri;
@ -41,15 +92,59 @@ void JobTaskDb::SetReportUri(const std::string& reportUri)
const std::string JobTaskDb::GetReportUri() const std::string JobTaskDb::GetReportUri()
{ {
pthread_mutex_lock(&jobTaskDbLock); return this->reportUri;
std::string reportUri = this->reportUri; }
pthread_mutex_unlock(&jobTaskDbLock);
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; 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 ComputeClusterTaskInformation::GetJson() const
{ {
json::value obj; json::value obj;
@ -122,6 +217,26 @@ json::value JobTaskDb::GetNodeInfo()
return obj; 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) void JobTaskDb::StartJobAndTask(int jobId, int taskId, ProcessStartInfo* startInfo, const std::string& callbackUri)
{ {
std::cout << "Enter StartJobAndTask" << std::endl; std::cout << "Enter StartJobAndTask" << std::endl;

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

@ -3,11 +3,42 @@
#include "ProcessStartInfo.h" #include "ProcessStartInfo.h"
#include "Executor.h" #include "Executor.h"
#include "Monitoring.h"
#include <syslog.h> #include <syslog.h>
#include <time.h>
class Executor; 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 struct ComputeClusterTaskInformation
{ {
public: public:
@ -74,6 +105,7 @@ class JobTaskDb
// Not acquiring locks for singleton. We can initialize in the very beginning. // Not acquiring locks for singleton. We can initialize in the very beginning.
static void Initialize() static void Initialize()
{ {
std::cout << "JobTaskDb : Initializing" << std::endl;
instance = new JobTaskDb(); instance = new JobTaskDb();
char nodeName[256]; char nodeName[256];
@ -93,6 +125,8 @@ class JobTaskDb
if (uriFile) if (uriFile)
{ {
uriFile >> instance->reportUri; uriFile >> instance->reportUri;
instance->metricReportUri = instance->GetMetricReportUri(instance->reportUri);
std::cout << "Loaded Report Uri: " << instance->reportUri << std::endl; std::cout << "Loaded Report Uri: " << instance->reportUri << std::endl;
} }
else else
@ -102,6 +136,7 @@ class JobTaskDb
} }
web::json::value GetNodeInfo(); web::json::value GetNodeInfo();
web::json::value GetMetricInfo();
web::json::value GetTaskInfo(int jobId, int taskId) const; web::json::value GetTaskInfo(int jobId, int taskId) const;
void StartJobAndTask(int jobId, int taskId, ProcessStartInfo* startInfo, const std::string& callbackUri); void StartJobAndTask(int jobId, int taskId, ProcessStartInfo* startInfo, const std::string& callbackUri);
void EndJob(int jobId); void EndJob(int jobId);
@ -109,20 +144,26 @@ class JobTaskDb
void RemoveTask(int jobId, int taskId); void RemoveTask(int jobId, int taskId);
void SetReportUri(const std::string& reportUri); void SetReportUri(const std::string& reportUri);
const std::string GetReportUri(); const std::string GetReportUri();
const std::string GetMetricReportUri();
std::string GetMetricReportUri(std::string & reportUri);
protected: protected:
private: private:
JobTaskDb(); JobTaskDb();
~JobTaskDb();
void Callback(std::string callbackUri, web::json::value callbackBody); void Callback(std::string callbackUri, web::json::value callbackBody);
static JobTaskDb* instance; static JobTaskDb* instance;
pthread_mutex_t jobTaskDbLock; pthread_mutex_t jobTaskDbLock;
pthread_t *threadId; pthread_t threadId;
pthread_t metricThreadId;
std::string reportUri; std::string reportUri;
std::string metricReportUri;
ComputeClusterNodeInformation nodeInfo; ComputeClusterNodeInformation nodeInfo;
Executor* executor; Executor* executor;
Monitoring monitoring;
}; };
#endif // JOBTASKDB_H #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 = DEP_RELEASE =
OUT_RELEASE = bin/Release/NM 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 all: debug release
@ -80,6 +80,9 @@ $(OBJDIR_DEBUG)/UnionFindSet.o: UnionFindSet.cpp
$(OBJDIR_DEBUG)/main.o: main.cpp $(OBJDIR_DEBUG)/main.o: main.cpp
$(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c main.cpp -o $(OBJDIR_DEBUG)/main.o $(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: clean_debug:
rm -f $(OBJ_DEBUG) $(OUT_DEBUG) rm -f $(OBJ_DEBUG) $(OUT_DEBUG)
rm -rf bin/Debug rm -rf bin/Debug
@ -117,6 +120,9 @@ $(OBJDIR_RELEASE)/UnionFindSet.o: UnionFindSet.cpp
$(OBJDIR_RELEASE)/main.o: main.cpp $(OBJDIR_RELEASE)/main.o: main.cpp
$(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c main.cpp -o $(OBJDIR_RELEASE)/main.o $(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: clean_release:
rm -f $(OBJ_RELEASE) $(OUT_RELEASE) rm -f $(OBJ_RELEASE) $(OUT_RELEASE)
rm -rf bin/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]; char scriptPath[256];
strcpy(scriptPath, "/tmp/run.XXXXXX"); strcpy(scriptPath, "/tmp/run.XXXXXX");
/* Make temp file */ /* Make temp file */
if (mkstemp(scriptPath) < 0) if (mkstemp(scriptPath) < 0)
{ {
return ""; return "";
} }
else else
{ {
std::cout << "Script temp file name: " << scriptPath << std::endl; std::cout << "Script temp file name: " << scriptPath << std::endl;
} }
commandScript = scriptPath; commandScript = scriptPath;

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

@ -46,8 +46,9 @@ void HandleJson::Ping(std::string callBackUri)
web::http::http_request request; web::http::http_request request;
request.set_method(http::methods::POST); request.set_method(http::methods::POST);
std::string body = JobTaskDb::GetInstance().GetNodeInfo().serialize(); 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")); request.set_body(body, U("application/json"));
client.request(request).then([](pplx::task<web::http::http_response> t) 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> template<typename T>
void HandleJson::HandleError(pplx::task<T>& t) void HandleJson::HandleError(pplx::task<T>& t)
{ {

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

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

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

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