Update aspnet50/aspnetcore50 => dnx451/dnxcore50.

This commit is contained in:
N. Taylor Mullen 2015-03-08 13:00:33 -07:00
Родитель 74ea7f723d
Коммит 099494c5d3
42 изменённых файлов: 117 добавлений и 117 удалений

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

@ -1,10 +1,10 @@
{
{
"dependencies": {
"Microsoft.Net.Http.Server": "1.0.0-*"
},
"frameworks": {
"aspnet50": { },
"aspnetcore50": {
"dnx451": { },
"dnxcore50": {
"dependencies": {
"System.Collections": "4.0.10-beta-*",
"System.Console": "4.0.0-beta-*",

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

@ -17,7 +17,7 @@
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:12345"
},
"frameworks" : {
"aspnet50" : { },
"aspnetcore50" : { }
"dnx451" : { },
"dnxcore50" : { }
}
}

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

@ -1,4 +1,4 @@
{
{
"webroot": "wwwroot",
"dependencies": {
"Microsoft.AspNet.Hosting": "1.0.0-*",
@ -7,7 +7,7 @@
},
"commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:8080" },
"frameworks": {
"aspnet50": { },
"aspnetcore50": { }
"dnx451": { },
"dnxcore50": { }
}
}

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

@ -1,4 +1,4 @@
{
{
"version": "1.0.0-*",
"description": "ASP.NET 5 self-host web server.",
"dependencies": {
@ -15,7 +15,7 @@
"allowUnsafe": true
},
"frameworks": {
"aspnet50": { },
"aspnetcore50": { }
"dnx451": { },
"dnxcore50": { }
}
}

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -38,7 +38,7 @@ namespace Microsoft.Net.Http.Server
/// </summary>
public sealed class AuthenticationManager
{
#if ASPNETCORE50
#if DNXCORE50
private static readonly int AuthInfoSize =
Marshal.SizeOf<UnsafeNclNativeMethods.HttpApi.HTTP_SERVER_AUTHENTICATION_INFO>();
#else

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Server
static ComNetOS()
{
#if ASPNETCORE50
#if DNXCORE50
// TODO: SkipIOCPCallbackOnSuccess doesn't work on Win7. Need a way to detect Win7 vs 8+.
IsWin8orLater = false;
#else

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -26,7 +26,7 @@ using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Security;
#if !ASPNETCORE50
#if !DNXCORE50
using Microsoft.Win32;
#endif
@ -34,7 +34,7 @@ namespace Microsoft.Net.Http.Server
{
internal static class HttpSysSettings
{
#if !ASPNETCORE50
#if !DNXCORE50
private const string HttpSysParametersKey = @"System\CurrentControlSet\Services\HTTP\Parameters";
#endif
private const bool EnableNonUtf8Default = true;
@ -61,7 +61,7 @@ namespace Microsoft.Net.Http.Server
}
private static void ReadHttpSysRegistrySettings()
#if ASPNETCORE50
#if DNXCORE50
{
}
#else

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Server
get
{
return Environment.HasShutdownStarted
#if !ASPNETCORE50
#if !DNXCORE50
|| AppDomain.CurrentDomain.IsFinalizingForUnload()
#endif
;

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Server
{
private const string HTTPAPI = "httpapi.dll";
#if ASPNETCORE50
#if DNXCORE50
private const string sspicli_LIB = "sspicli.dll";
private const string api_ms_win_core_processthreads_LIB = "api-ms-win-core-processthreads-l1-1-1.dll";
private const string api_ms_win_core_io_LIB = "api-ms-win-core-io-l1-1-1.dll";
@ -59,21 +59,21 @@ namespace Microsoft.Net.Http.Server
internal const uint ERROR_CONNECTION_INVALID = 1229;
}
#if ASPNETCORE50
#if DNXCORE50
[DllImport(api_ms_win_core_processthreads_LIB, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
#else
[DllImport(KERNEL32, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
#endif
internal static extern uint GetCurrentThreadId();
#if ASPNETCORE50
#if DNXCORE50
[DllImport(api_ms_win_core_io_LIB, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
#else
[DllImport(KERNEL32, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
#endif
internal static unsafe extern uint CancelIoEx(SafeHandle handle, SafeNativeOverlapped overlapped);
#if ASPNETCORE50
#if DNXCORE50
[DllImport(api_ms_win_core_kernel32_legacy_LIB, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
#else
[DllImport(KERNEL32, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
@ -90,7 +90,7 @@ namespace Microsoft.Net.Http.Server
internal static class SafeNetHandles
{
#if ASPNETCORE50
#if DNXCORE50
[DllImport(sspicli_LIB, ExactSpelling = true, SetLastError = true)]
#else
[DllImport(SECUR32, ExactSpelling = true, SetLastError = true)]
@ -98,7 +98,7 @@ namespace Microsoft.Net.Http.Server
internal static extern int FreeContextBuffer(
[In] IntPtr contextBuffer);
#if ASPNETCORE50
#if DNXCORE50
[DllImport(sspicli_LIB, ExactSpelling = true, SetLastError = true)]
#else
[DllImport(SECUR32, ExactSpelling = true, SetLastError = true)]
@ -115,21 +115,21 @@ namespace Microsoft.Net.Http.Server
[DllImport(HTTPAPI, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
internal static extern unsafe uint HttpCloseRequestQueue(IntPtr pReqQueueHandle);
#if ASPNETCORE50
#if DNXCORE50
[DllImport(api_ms_win_core_handle_LIB, ExactSpelling = true, SetLastError = true)]
#else
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]
#endif
internal static extern bool CloseHandle(IntPtr handle);
#if ASPNETCORE50
#if DNXCORE50
[DllImport(api_ms_win_core_heap_obsolete_LIB, ExactSpelling = true, SetLastError = true)]
#else
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]
#endif
internal static extern SafeLocalFree LocalAlloc(int uFlags, UIntPtr sizetdwBytes);
#if ASPNETCORE50
#if DNXCORE50
[DllImport(api_ms_win_core_heap_obsolete_LIB, EntryPoint = "LocalAlloc", SetLastError = true)]
#else
[DllImport(KERNEL32, EntryPoint = "LocalAlloc", SetLastError = true)]
@ -137,21 +137,21 @@ namespace Microsoft.Net.Http.Server
internal static extern SafeLocalFreeChannelBinding LocalAllocChannelBinding(int uFlags, UIntPtr sizetdwBytes);
#if ASPNETCORE50
#if DNXCORE50
[DllImport(api_ms_win_core_heap_obsolete_LIB, ExactSpelling = true, SetLastError = true)]
#else
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]
#endif
internal static extern IntPtr LocalFree(IntPtr handle);
#if ASPNETCORE50
#if DNXCORE50
[DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)]
#else
[DllImport(KERNEL32, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)]
#endif
internal static extern unsafe SafeLoadLibrary LoadLibraryExW([In] string lpwLibFileName, [In] void* hFile, [In] uint dwFlags);
#if ASPNETCORE50
#if DNXCORE50
[DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, SetLastError = true)]
#else
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -109,7 +109,7 @@ namespace Microsoft.Net.Http.Server
{
return _requestStream.ReadByte();
}
#if !ASPNETCORE50
#if !DNXCORE50
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
return _requestStream.BeginRead(buffer, offset, count, callback, state);
@ -143,7 +143,7 @@ namespace Microsoft.Net.Http.Server
{
_responseStream.WriteByte(value);
}
#if !ASPNETCORE50
#if !DNXCORE50
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
return _responseStream.BeginWrite(buffer, offset, count, callback, state);

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -198,7 +198,7 @@ namespace Microsoft.Net.Http.Server
}
}
#if ASPNETCORE50
#if DNXCORE50
public unsafe IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
#else
public override unsafe IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
@ -291,7 +291,7 @@ namespace Microsoft.Net.Http.Server
return asyncResult;
}
#if ASPNETCORE50
#if DNXCORE50
public int EndRead(IAsyncResult asyncResult)
#else
public override int EndRead(IAsyncResult asyncResult)
@ -426,7 +426,7 @@ namespace Microsoft.Net.Http.Server
throw new InvalidOperationException(Resources.Exception_ReadOnlyStream);
}
#if ASPNETCORE50
#if DNXCORE50
public IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
#else
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
@ -435,7 +435,7 @@ namespace Microsoft.Net.Http.Server
throw new InvalidOperationException(Resources.Exception_ReadOnlyStream);
}
#if ASPNETCORE50
#if DNXCORE50
public void EndWrite(IAsyncResult asyncResult)
#else
public override void EndWrite(IAsyncResult asyncResult)

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -70,7 +70,7 @@ namespace Microsoft.Net.Http.Server
// TODO: False triggers more detailed/correct parsing, but it's rather slow.
UseCookedRequestUrl = true; // SettingsSectionInternal.Section.HttpListenerUnescapeRequestUrl;
Utf8Encoding = new UTF8Encoding(false, true);
#if ASPNETCORE50
#if DNXCORE50
AnsiEncoding = Utf8Encoding;
#else
AnsiEncoding = Encoding.GetEncoding(0, new EncoderExceptionFallback(), new DecoderExceptionFallback());

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -709,7 +709,7 @@ namespace Microsoft.Net.Http.Server
knownHeaderInfo[_nativeResponse.ResponseInfoCount].Type = UnsafeNclNativeMethods.HttpApi.HTTP_RESPONSE_INFO_TYPE.HttpResponseInfoTypeMultipleKnownHeaders;
knownHeaderInfo[_nativeResponse.ResponseInfoCount].Length =
#if ASPNETCORE50
#if DNXCORE50
(uint)Marshal.SizeOf<UnsafeNclNativeMethods.HttpApi.HTTP_MULTIPLE_KNOWN_HEADERS>();
#else
(uint)Marshal.SizeOf(typeof(UnsafeNclNativeMethods.HttpApi.HTTP_MULTIPLE_KNOWN_HEADERS));

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -195,7 +195,7 @@ namespace Microsoft.Net.Http.Server
throw new InvalidOperationException(Resources.Exception_WriteOnlyStream);
}
#if !ASPNETCORE50
#if !DNXCORE50
public override IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
{
throw new InvalidOperationException(Resources.Exception_WriteOnlyStream);
@ -360,7 +360,7 @@ namespace Microsoft.Net.Http.Server
// TODO: Verbose log data written
}
#if ASPNETCORE50
#if DNXCORE50
public unsafe IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
#else
public override unsafe IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
@ -465,7 +465,7 @@ namespace Microsoft.Net.Http.Server
return asyncResult;
}
#if ASPNETCORE50
#if DNXCORE50
public void EndWrite(IAsyncResult asyncResult)
#else
public override void EndWrite(IAsyncResult asyncResult)

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -140,7 +140,7 @@ namespace Microsoft.Net.Http.Server
overlapped.AsyncResult = this;
int bufferSize = 1024 * 64; // TODO: Validate buffer size choice.
#if ASPNETCORE50
#if DNXCORE50
_fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, bufferSize /*, useAsync: true*/); // Extremely expensive.
#else
// It's too expensive to validate anything before opening the file. Open the file and then check the lengths.

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -35,7 +35,7 @@ namespace Microsoft.Net.Http.Server
/// </summary>
public sealed class TimeoutManager
{
#if ASPNETCORE50
#if DNXCORE50
private static readonly int TimeoutLimitSize =
Marshal.SizeOf<UnsafeNclNativeMethods.HttpApi.HTTP_TIMEOUT_LIMIT_INFO>();
#else

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -41,7 +41,7 @@ namespace Microsoft.Net.Http.Server
public sealed class WebListener : IDisposable
{
private const long DefaultRequestQueueLength = 1000; // Http.sys default.
#if ASPNETCORE50
#if DNXCORE50
private static readonly int RequestChannelBindStatusSize =
Marshal.SizeOf<UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_CHANNEL_BIND_STATUS>();
private static readonly int BindingInfoSize =
@ -749,7 +749,7 @@ namespace Microsoft.Net.Http.Server
knownHeaderInfo[httpResponse.ResponseInfoCount].Type = UnsafeNclNativeMethods.HttpApi.HTTP_RESPONSE_INFO_TYPE.HttpResponseInfoTypeMultipleKnownHeaders;
knownHeaderInfo[httpResponse.ResponseInfoCount].Length =
#if ASPNETCORE50
#if DNXCORE50
(uint)Marshal.SizeOf<UnsafeNclNativeMethods.HttpApi.HTTP_MULTIPLE_KNOWN_HEADERS>();
#else
(uint)Marshal.SizeOf(typeof(UnsafeNclNativeMethods.HttpApi.HTTP_MULTIPLE_KNOWN_HEADERS));
@ -841,7 +841,7 @@ namespace Microsoft.Net.Http.Server
private static int GetTokenOffsetFromBlob(IntPtr blob)
{
Debug.Assert(blob != IntPtr.Zero);
#if ASPNETCORE50
#if DNXCORE50
IntPtr tokenPointer = Marshal.ReadIntPtr(blob, (int)Marshal.OffsetOf<UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_CHANNEL_BIND_STATUS>("ChannelToken"));
#else
IntPtr tokenPointer = Marshal.ReadIntPtr(blob, (int)Marshal.OffsetOf(ChannelBindingStatusType, "ChannelToken"));
@ -853,7 +853,7 @@ namespace Microsoft.Net.Http.Server
private static int GetTokenSizeFromBlob(IntPtr blob)
{
Debug.Assert(blob != IntPtr.Zero);
#if ASPNETCORE50
#if DNXCORE50
return Marshal.ReadInt32(blob, (int)Marshal.OffsetOf<UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_CHANNEL_BIND_STATUS>("ChannelTokenSize"));
#else
return Marshal.ReadInt32(blob, (int)Marshal.OffsetOf(ChannelBindingStatusType, "ChannelTokenSize"));

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -45,7 +45,7 @@ namespace Microsoft.Net.Http.Server
: base(errorCode, message)
{
}
#if ASPNETCORE50
#if DNXCORE50
public int ErrorCode
#else
// the base class returns the HResult with this property

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -21,7 +21,7 @@
//
// ==--==
#if ASPNETCORE50
#if DNXCORE50
namespace Microsoft.Win32.SafeHandles
{

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -21,7 +21,7 @@
//
// ==--==
#if ASPNETCORE50
#if DNXCORE50
namespace Microsoft.Win32.SafeHandles
{

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if ASPNETCORE50
#if DNXCORE50
using System;
using System.ComponentModel;

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if ASPNETCORE50
#if DNXCORE50
namespace System
{
@ -30,4 +30,4 @@ namespace System
public const string api_ms_win_core_localization_LIB = "api-ms-win-core-localization-l2-1-0.dll";
}
}
#endif
#endif

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -31,7 +31,7 @@
**
=============================================================================*/
#if ASPNETCORE50
#if DNXCORE50
namespace System.Runtime.InteropServices
{

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if ASPNETCORE50
#if DNXCORE50
using System.Runtime.InteropServices;
using System.Text;

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

@ -1,4 +1,4 @@
{
{
"version": "1.0.0-*",
"description": "Implementation of WebListener, a successor to HttpListener. It is used in the WebListener server package.",
"dependencies": {
@ -10,8 +10,8 @@
},
"frameworks": {
"net45": { },
"aspnet50": { },
"aspnetcore50": {
"dnx451": { },
"dnxcore50": {
"dependencies": {
"Microsoft.Win32.Primitives": "4.0.0-beta-*",
"System.Diagnostics.Debug": "4.0.10-beta-*",

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -87,7 +87,7 @@ namespace Microsoft.Net.WebSockets
get
{
return Environment.HasShutdownStarted
#if !ASPNETCORE50
#if !DNXCORE50
|| AppDomain.CurrentDomain.IsFinalizingForUnload()
#endif
;

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -31,7 +31,7 @@ namespace Microsoft.Net.WebSockets
{
internal static class UnsafeNativeMethods
{
#if ASPNETCORE50
#if DNXCORE50
private const string api_ms_win_core_libraryloader_LIB = "api-ms-win-core-libraryloader-l1-1-0.dll";
#else
private const string KERNEL32 = "kernel32.dll";
@ -40,14 +40,14 @@ namespace Microsoft.Net.WebSockets
internal static class SafeNetHandles
{
#if ASPNETCORE50
#if DNXCORE50
[DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)]
#else
[DllImport(KERNEL32, ExactSpelling = true, CharSet=CharSet.Unicode, SetLastError = true)]
#endif
internal static extern unsafe SafeLoadLibrary LoadLibraryExW([In] string lpwLibFileName, [In] void* hFile, [In] uint dwFlags);
#if ASPNETCORE50
#if DNXCORE50
[DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, SetLastError = true)]
#else
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]
@ -173,7 +173,7 @@ namespace Microsoft.Net.WebSockets
static WebSocketProtocolComponent()
{
#if ASPNETCORE50
#if DNXCORE50
DllFileName = Path.Combine(Environment.GetEnvironmentVariable("SYSTEMROOT"), "System32", WEBSOCKET);
#else
DllFileName = Path.Combine(Environment.SystemDirectory, WEBSOCKET);

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -1103,7 +1103,7 @@ namespace Microsoft.Net.WebSockets
if (thisLockTaken || sessionHandleLockTaken)
{
#if !ASPNETCORE50
#if !DNXCORE50
RuntimeHelpers.PrepareConstrainedRegions();
#endif
try
@ -1189,7 +1189,7 @@ namespace Microsoft.Net.WebSockets
Contract.Assert(lockObject != null, "'lockObject' MUST NOT be NULL.");
if (lockTaken)
{
#if !ASPNETCORE50
#if !DNXCORE50
RuntimeHelpers.PrepareConstrainedRegions();
#endif
try
@ -2253,7 +2253,7 @@ namespace Microsoft.Net.WebSockets
"'webSocket.m_KeepAliveTracker' MUST NOT be NULL at this point.");
int keepAliveIntervalMilliseconds = (int)_keepAliveInterval.TotalMilliseconds;
Contract.Assert(keepAliveIntervalMilliseconds > 0, "'keepAliveIntervalMilliseconds' MUST be POSITIVE.");
#if ASPNETCORE50
#if DNXCORE50
_keepAliveTimer = new Timer(_keepAliveTimerElapsedCallback, webSocket, keepAliveIntervalMilliseconds, Timeout.Infinite);
#else
if (ExecutionContext.IsFlowSuppressed())

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -50,7 +50,7 @@ namespace Microsoft.Net.WebSockets
public const int MinSendBufferSize = 16;
internal const int MinReceiveBufferSize = 256;
internal const int MaxBufferSize = 64 * 1024;
#if ASPNETCORE50
#if DNXCORE50
private static readonly int SizeOfUInt = Marshal.SizeOf<uint>();
private static readonly int SizeOfBool = Marshal.SizeOf<bool>();
#else

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -28,7 +28,7 @@ using System.Runtime.InteropServices;
namespace Microsoft.Net.WebSockets
{
#if !ASPNETCORE50
#if !DNXCORE50
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable")]
#endif
internal sealed class WebSocketException : Win32Exception

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -21,7 +21,7 @@
//
// ==--==
#if ASPNETCORE50
#if DNXCORE50
namespace Microsoft.Win32.SafeHandles
{

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -15,7 +15,7 @@
// See the Apache 2 License for the specific language governing
// permissions and limitations under the License.
#if ASPNETCORE50
#if DNXCORE50
using System;
using System.Collections.Generic;

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if ASPNETCORE50
#if DNXCORE50
using System.Runtime.InteropServices;
using System.Text;

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if ASPNETCORE50
#if DNXCORE50
namespace System
{
@ -30,4 +30,4 @@ namespace System
public const string api_ms_win_core_localization_LIB = "api-ms-win-core-localization-l2-1-0.dll";
}
}
#endif
#endif

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -31,7 +31,7 @@
**
=============================================================================*/
#if ASPNETCORE50
#if DNXCORE50
namespace System.Runtime.InteropServices
{

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if ASPNETCORE50
#if DNXCORE50
using System.Runtime.InteropServices;
using System.Text;

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -15,7 +15,7 @@
// See the Apache 2 License for the specific language governing
// permissions and limitations under the License.
#if ASPNETCORE50
#if DNXCORE50
using System;
using System.Collections.Generic;

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

@ -1,4 +1,4 @@
{
{
"version": "1.0.0-*",
"description": "Implementation of WebSocket abstract base class. Used by WebListener.",
"dependencies": {
@ -7,7 +7,7 @@
"compilationOptions": { "allowUnsafe": true },
"frameworks": {
"net45": { },
"aspnetcore50": {
"dnxcore50": {
"dependencies": {
"System.Collections": "4.0.10-beta-*",
"System.Diagnostics.Contracts": "4.0.0-beta-*",

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -67,7 +67,7 @@ namespace Microsoft.AspNet.Server.WebListener
Assert.Equal("Hello World", response);
}
}
#if !ASPNETCORE50
#if !DNXCORE50
[Fact]
public async Task RequestBody_ReadBeginEnd_Success()
{

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

@ -1,4 +1,4 @@
{
{
"commands": {
"test": "xunit.runner.kre"
},
@ -9,7 +9,7 @@
"xunit.runner.kre": "1.0.0-*"
},
"frameworks": {
"aspnet50": {
"dnx451": {
"frameworkAssemblies": {
"System.Net.Http": "",
"System.Net.Http.WebRequest": ""

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

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
using System;
using System.IO;
@ -51,7 +51,7 @@ namespace Microsoft.Net.Http.Server
Assert.Equal("Hello World", response);
}
}
#if ASPNET50
#if DNX451
[Fact]
public async Task RequestBody_ReadBeginEnd_Success()
{

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

@ -1,4 +1,4 @@
{
{
"commands": {
"test": "xunit.runner.kre"
},
@ -8,7 +8,7 @@
"xunit.runner.kre": "1.0.0-*"
},
"frameworks": {
"aspnet50": {
"dnx451": {
frameworkAssemblies: {
"System.Net.Http": "",
"System.Net.Http.WebRequest": ""