Merge pull request #823 from DavidKarlas/master
[mono.git] / mcs / class / System / System.Net.WebSockets / WebSocketReceiveResult.cs
1 //
2 // WebSocketReceiveResult.cs
3 //
4 // Authors:
5 //    Jérémie Laval <jeremie dot laval at xamarin dot com>
6 //
7 // Copyright 2013 Xamarin Inc (http://www.xamarin.com).
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to deal
11 // in the Software without restriction, including without limitation the rights
12 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 // copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
15 //
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
18 //
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 // THE SOFTWARE.
26 //
27 //
28
29 #if NET_4_5
30
31 using System;
32 using System.Security.Principal;
33 using System.Runtime.CompilerServices;
34
35 namespace System.Net.WebSockets
36 {
37         public class WebSocketReceiveResult
38         {
39                 public WebSocketReceiveResult (int count, WebSocketMessageType messageType, bool endOfMessage)
40                      : this (count, messageType, endOfMessage, null, null)
41                 {
42                 }
43
44                 public WebSocketReceiveResult (int count,
45                                                WebSocketMessageType messageType,
46                                                bool endOfMessage,
47                                                WebSocketCloseStatus? closeStatus,
48                                                string closeStatusDescription)
49                 {
50                         MessageType = messageType;
51                         CloseStatus = closeStatus;
52                         CloseStatusDescription = closeStatusDescription;
53                         Count = count;
54                         EndOfMessage = endOfMessage;
55                 }
56
57                 public WebSocketCloseStatus? CloseStatus {
58                         get;
59                         private set;
60                 }
61
62                 public string CloseStatusDescription {
63                         get;
64                         private set;
65                 }
66
67                 public int Count {
68                         get;
69                         private set;
70                 }
71
72                 public bool EndOfMessage {
73                         get;
74                         private set;
75                 }
76
77                 public WebSocketMessageType MessageType {
78                         get;
79                         private set;
80                 }
81         }
82 }
83
84 #endif