1 // Licensed to the .NET Foundation under one or more agreements. 2 // The .NET Foundation licenses this file to you under the MIT license. 3 // See the LICENSE file in the project root for more information. 4 5 using System; 6 using System.Net.WebSockets; 7 using System.Runtime.InteropServices; 8 9 internal static partial class Interop 10 { 11 internal static partial class WebSocket 12 { 13 [StructLayout(LayoutKind.Explicit)] 14 internal struct Buffer 15 { 16 [FieldOffset(0)] 17 internal DataBuffer Data; 18 [FieldOffset(0)] 19 internal CloseBuffer CloseStatus; 20 } 21 22 [StructLayout(LayoutKind.Sequential)] 23 internal struct Property 24 { 25 internal WebSocketProtocolComponent.PropertyType Type; 26 internal IntPtr PropertyData; 27 internal uint PropertySize; 28 } 29 30 [StructLayout(LayoutKind.Sequential)] 31 internal struct DataBuffer 32 { 33 internal IntPtr BufferData; 34 internal uint BufferLength; 35 } 36 37 [StructLayout(LayoutKind.Sequential)] 38 internal struct CloseBuffer 39 { 40 internal IntPtr ReasonData; 41 internal uint ReasonLength; 42 internal ushort CloseStatus; 43 } 44 45 [StructLayout(LayoutKind.Sequential)] 46 internal struct HttpHeader 47 { 48 [MarshalAs(UnmanagedType.LPStr)] 49 internal string Name; 50 internal uint NameLength; 51 [MarshalAs(UnmanagedType.LPStr)] 52 internal string Value; 53 internal uint ValueLength; 54 } 55 } 56 } 57