Fix for issue #15
This commit is contained in:
@@ -73,6 +73,22 @@ namespace WebSocketSharp {
|
||||
|
||||
#region Internal Method
|
||||
|
||||
internal static string GetNameInternal(this string nameAndValue, string separator)
|
||||
{
|
||||
int i = nameAndValue.IndexOf(separator);
|
||||
return i > 0
|
||||
? nameAndValue.Substring(0, i).Trim()
|
||||
: null;
|
||||
}
|
||||
|
||||
internal static string GetValueInternal(this string nameAndValue, string separator)
|
||||
{
|
||||
int i = nameAndValue.IndexOf(separator);
|
||||
return i >= 0 && i < nameAndValue.Length - 1
|
||||
? nameAndValue.Substring(i + 1).Trim()
|
||||
: null;
|
||||
}
|
||||
|
||||
internal static bool IsText(this string value)
|
||||
{
|
||||
int len = value.Length;
|
||||
@@ -100,7 +116,7 @@ namespace WebSocketSharp {
|
||||
{
|
||||
foreach (char c in value)
|
||||
{
|
||||
if (c < 0x20 || c >= 0x7f || _tspecials.Contains (c))
|
||||
if (c < 0x20 || c >= 0x7f || _tspecials.Contains(c))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -337,6 +353,28 @@ namespace WebSocketSharp {
|
||||
: uriString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of cookies from the specified <see cref="NameValueCollection"/>.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="CookieCollection"/> that receives a collection of the HTTP Cookies.
|
||||
/// </returns>
|
||||
/// <param name="headers">
|
||||
/// A <see cref="NameValueCollection"/> that contains a collection of the HTTP Headers.
|
||||
/// </param>
|
||||
/// <param name="response">
|
||||
/// <c>true</c> if gets from the response <paramref name="headers"/>;
|
||||
/// from the request <paramref name="headers"/>, <c>false</c>.
|
||||
/// </param>
|
||||
public static CookieCollection GetCookies(this NameValueCollection headers, bool response)
|
||||
{
|
||||
var name = response ? "Set-Cookie" : "Cookie";
|
||||
if (headers.IsNull() || !headers.Exists(name))
|
||||
return new CookieCollection();
|
||||
|
||||
return CookieCollection.Parse(headers[name], response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the description of the HTTP status code using the specified <see cref="WebSocketSharp.Net.HttpStatusCode"/>.
|
||||
/// </summary>
|
||||
@@ -365,15 +403,8 @@ namespace WebSocketSharp {
|
||||
/// </param>
|
||||
public static string GetName(this string nameAndValue, string separator)
|
||||
{
|
||||
if (nameAndValue.IsNullOrEmpty())
|
||||
return null;
|
||||
|
||||
if (separator.IsNullOrEmpty())
|
||||
return null;
|
||||
|
||||
var i = nameAndValue.IndexOf(separator);
|
||||
return i > 0
|
||||
? nameAndValue.Substring(0, i).Trim()
|
||||
return !nameAndValue.IsNullOrEmpty() && !separator.IsNullOrEmpty()
|
||||
? nameAndValue.GetNameInternal(separator)
|
||||
: null;
|
||||
}
|
||||
|
||||
@@ -476,15 +507,8 @@ namespace WebSocketSharp {
|
||||
/// </param>
|
||||
public static string GetValue(this string nameAndValue, string separator)
|
||||
{
|
||||
if (nameAndValue.IsNullOrEmpty())
|
||||
return null;
|
||||
|
||||
if (separator.IsNullOrEmpty())
|
||||
return null;
|
||||
|
||||
var i = nameAndValue.IndexOf(separator);
|
||||
return i >= 0 && i < nameAndValue.Length - 1
|
||||
? nameAndValue.Substring(i + 1).Trim()
|
||||
return !nameAndValue.IsNullOrEmpty() && !separator.IsNullOrEmpty()
|
||||
? nameAndValue.GetValueInternal(separator)
|
||||
: null;
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (c) 2012 sta.blockhead
|
||||
* Copyright (c) 2012-2013 sta.blockhead
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
@@ -7,6 +7,7 @@
|
||||
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
|
||||
// Daniel Nauck (dna@mono-project.de)
|
||||
// Sebastien Pouliot (sebastien@ximian.com)
|
||||
// sta (sta.blockhead@gmail.com)
|
||||
//
|
||||
// Copyright (c) 2004,2009 Novell, Inc (http://www.novell.com)
|
||||
// Copyright (c) 2012-2013 sta.blockhead (sta.blockhead@gmail.com)
|
||||
@@ -241,6 +242,22 @@ namespace WebSocketSharp.Net {
|
||||
|
||||
internal bool ExactDomain { get; set; }
|
||||
|
||||
internal int MaxAge {
|
||||
get {
|
||||
if (expires == DateTime.MinValue || Expired)
|
||||
return 0;
|
||||
|
||||
var tmp = expires.Kind == DateTimeKind.Local
|
||||
? expires
|
||||
: expires.ToLocalTime ();
|
||||
|
||||
var span = tmp - DateTime.Now;
|
||||
return span <= TimeSpan.Zero
|
||||
? 0
|
||||
: (int) span.TotalSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
internal int [] Ports {
|
||||
get { return ports; }
|
||||
}
|
||||
@@ -308,16 +325,17 @@ namespace WebSocketSharp.Net {
|
||||
/// Gets or sets a value indicating whether the cookie has expired.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if the cookie has expired; otherwise, <c>false</c>.
|
||||
/// <c>true</c> if the cookie has expired; otherwise, <c>false</c>. The default is <c>false</c>.
|
||||
/// </value>
|
||||
public bool Expired {
|
||||
get {
|
||||
return expires <= DateTime.Now &&
|
||||
expires != DateTime.MinValue;
|
||||
}
|
||||
set {
|
||||
if (value)
|
||||
expires = DateTime.Now;
|
||||
set {
|
||||
expires = value
|
||||
? DateTime.Now
|
||||
: DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,6 +344,7 @@ namespace WebSocketSharp.Net {
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// A <see cref="DateTime"/> that contains the date and time at which the cookie expires.
|
||||
/// The default is <see cref="DateTime.MinValue"/>.
|
||||
/// </value>
|
||||
public DateTime Expires {
|
||||
get { return expires; }
|
||||
@@ -390,7 +409,7 @@ namespace WebSocketSharp.Net {
|
||||
/// A <see cref="string"/> that contains a list of the TCP ports to which the cookie applies.
|
||||
/// </value>
|
||||
/// <exception cref="CookieException">
|
||||
/// The value specified for a set operation could not be parsed or is not enclosed in double quotes.
|
||||
/// The value specified for a set operation is not enclosed in double quotes or could not be parsed.
|
||||
/// </exception>
|
||||
public string Port {
|
||||
get { return port; }
|
||||
@@ -402,11 +421,13 @@ namespace WebSocketSharp.Net {
|
||||
}
|
||||
|
||||
if (!value.IsEnclosedIn ('"'))
|
||||
throw new CookieException ("The 'Port'='" + value + "' attribute of the cookie is invalid. Port must be enclosed in double quotes.");
|
||||
throw new CookieException (String.Format (
|
||||
"The 'Port={0}' attribute of the cookie is invalid. The value must be enclosed in double quotes.", value));
|
||||
|
||||
string error;
|
||||
if (!TryCreatePorts (value, out ports, out error))
|
||||
throw new CookieException ("The 'Port'='" + value + "' attribute of the cookie is invalid. Invalid value: " + error);
|
||||
throw new CookieException (String.Format (
|
||||
"The 'Port={0}' attribute of the cookie is invalid. Invalid value: {1}", value, error));
|
||||
|
||||
port = value;
|
||||
}
|
||||
@@ -472,13 +493,13 @@ namespace WebSocketSharp.Net {
|
||||
/// to which the cookie conforms.
|
||||
/// </value>
|
||||
/// <exception cref="ArgumentOutOfRangeException">
|
||||
/// The value specified for a set operation is less than zero.
|
||||
/// The value specified for a set operation is not allowed. The value must be 0 or 1.
|
||||
/// </exception>
|
||||
public int Version {
|
||||
get { return version; }
|
||||
set {
|
||||
if (value < 0)
|
||||
throw new ArgumentOutOfRangeException();
|
||||
if (value < 0 || value > 1)
|
||||
throw new ArgumentOutOfRangeException ("value", "Must be 0 or 1.");
|
||||
else
|
||||
version = value;
|
||||
}
|
||||
@@ -536,6 +557,61 @@ namespace WebSocketSharp.Net {
|
||||
return "\"" + value.Replace("\"", "\\\"") + "\"";
|
||||
}
|
||||
|
||||
string ToResponseStringVersion0 ()
|
||||
{
|
||||
var result = new StringBuilder ();
|
||||
result.AppendFormat ("{0}={1}", name, val);
|
||||
if (expires != DateTime.MinValue)
|
||||
result.AppendFormat ("; Expires={0}",
|
||||
expires.ToUniversalTime ().ToString ("ddd, dd'-'MMM'-'yyyy HH':'mm':'ss 'GMT'",
|
||||
CultureInfo.CreateSpecificCulture("en-US")));
|
||||
|
||||
if (!path.IsNullOrEmpty ())
|
||||
result.AppendFormat ("; Path={0}", path);
|
||||
|
||||
if (!domain.IsNullOrEmpty ())
|
||||
result.AppendFormat ("; Domain={0}", domain);
|
||||
|
||||
if (secure)
|
||||
result.Append ("; Secure");
|
||||
|
||||
if (httpOnly)
|
||||
result.Append ("; HttpOnly");
|
||||
|
||||
return result.ToString ();
|
||||
}
|
||||
|
||||
string ToResponseStringVersion1 ()
|
||||
{
|
||||
var result = new StringBuilder ();
|
||||
result.AppendFormat ("{0}={1}; Version={2}", name, val, version);
|
||||
if (expires != DateTime.MinValue)
|
||||
result.AppendFormat ("; Max-Age={0}", MaxAge);
|
||||
|
||||
if (!path.IsNullOrEmpty ())
|
||||
result.AppendFormat ("; Path={0}", path);
|
||||
|
||||
if (!domain.IsNullOrEmpty ())
|
||||
result.AppendFormat ("; Domain={0}", domain);
|
||||
|
||||
if (!port.IsNullOrEmpty ())
|
||||
result.AppendFormat ("; Port={0}", port);
|
||||
|
||||
if (!comment.IsNullOrEmpty ())
|
||||
result.AppendFormat ("; Comment={0}", comment.UrlEncode ());
|
||||
|
||||
if (!commentUri.IsNull ())
|
||||
result.AppendFormat ("; CommentURL={0}", Quote (commentUri.OriginalString));
|
||||
|
||||
if (discard)
|
||||
result.Append ("; Discard");
|
||||
|
||||
if (secure)
|
||||
result.Append ("; Secure");
|
||||
|
||||
return result.ToString ();
|
||||
}
|
||||
|
||||
static bool TryCreatePorts (string value, out int [] result, out string parseError)
|
||||
{
|
||||
var values = value.Trim ('"').Split (',');
|
||||
@@ -562,60 +638,44 @@ namespace WebSocketSharp.Net {
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
// From server to client
|
||||
internal string ToClientString ()
|
||||
{
|
||||
if (name.IsEmpty ())
|
||||
return String.Empty;
|
||||
|
||||
var result = new StringBuilder (64);
|
||||
if (version > 0)
|
||||
result.Append ("Version=").Append (version).Append ("; ");
|
||||
|
||||
result.Append (name).Append ("=").Append (Quote (val));
|
||||
if (!path.IsNullOrEmpty ())
|
||||
result.Append ("; Path=").Append (path);
|
||||
|
||||
if (!domain.IsNullOrEmpty ())
|
||||
result.Append ("; Domain=").Append (domain);
|
||||
|
||||
if (!port.IsNullOrEmpty ())
|
||||
result.Append ("; Port=").Append (port);
|
||||
|
||||
return result.ToString ();
|
||||
}
|
||||
|
||||
// From client to server
|
||||
internal string ToString (Uri uri)
|
||||
internal string ToRequestString (Uri uri)
|
||||
{
|
||||
if (name.IsEmpty ())
|
||||
return String.Empty;
|
||||
|
||||
var result = new StringBuilder (64);
|
||||
if (version > 0)
|
||||
result.Append ("$Version=").Append (version).Append ("; ");
|
||||
|
||||
result.Append (name).Append ("=").Append (val);
|
||||
if (version == 0)
|
||||
return result.ToString ();
|
||||
return String.Format ("{0}={1}", name, val);
|
||||
|
||||
var result = new StringBuilder ();
|
||||
result.AppendFormat ("$Version={0}; {1}={2}", version, name, val);
|
||||
if (!path.IsNullOrEmpty ())
|
||||
result.Append ("; $Path=").Append (path);
|
||||
result.AppendFormat ("; $Path={0}", path);
|
||||
else if (!uri.IsNull ())
|
||||
result.Append ("; $Path=").Append (uri.GetAbsolutePath ());
|
||||
result.AppendFormat ("; $Path={0}", uri.GetAbsolutePath ());
|
||||
else
|
||||
result.Append ("; $Path=/");
|
||||
|
||||
bool append_domain = uri.IsNull () || uri.Host != domain;
|
||||
if (append_domain && !domain.IsNullOrEmpty ())
|
||||
result.Append ("; $Domain=").Append (domain);
|
||||
result.AppendFormat ("; $Domain={0}", domain);
|
||||
|
||||
if (!port.IsNullOrEmpty ())
|
||||
result.Append ("; $Port=").Append (port);
|
||||
result.AppendFormat ("; $Port={0}", port);
|
||||
|
||||
return result.ToString ();
|
||||
}
|
||||
|
||||
// From server to client
|
||||
internal string ToResponseString ()
|
||||
{
|
||||
return name.IsEmpty ()
|
||||
? String.Empty
|
||||
: version == 0
|
||||
? ToResponseStringVersion0 ()
|
||||
: ToResponseStringVersion1 ();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
@@ -634,11 +694,11 @@ namespace WebSocketSharp.Net {
|
||||
{
|
||||
var cookie = comparand as Cookie;
|
||||
return !cookie.IsNull() &&
|
||||
String.Compare (this.name, cookie.Name, true, CultureInfo.InvariantCulture) == 0 &&
|
||||
String.Compare (this.val, cookie.Value, false, CultureInfo.InvariantCulture) == 0 &&
|
||||
String.Compare (this.path, cookie.Path, false, CultureInfo.InvariantCulture) == 0 &&
|
||||
String.Compare (this.domain, cookie.Domain, true, CultureInfo.InvariantCulture) == 0 &&
|
||||
this.version == cookie.Version;
|
||||
name.Equals (cookie.Name, StringComparison.InvariantCultureIgnoreCase) &&
|
||||
val.Equals (cookie.Value, StringComparison.InvariantCulture) &&
|
||||
path.Equals (cookie.Path, StringComparison.InvariantCulture) &&
|
||||
domain.Equals (cookie.Domain, StringComparison.InvariantCultureIgnoreCase) &&
|
||||
version == cookie.Version;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -671,7 +731,7 @@ namespace WebSocketSharp.Net {
|
||||
// i.e., only used for clients
|
||||
// see para 4.2.2 of RFC 2109 and para 3.3.4 of RFC 2965
|
||||
// see also bug #316017
|
||||
return ToString (null);
|
||||
return ToRequestString (null);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@@ -5,7 +5,8 @@
|
||||
// Authors:
|
||||
// Lawrence Pit (loz@cable.a2000.nl)
|
||||
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
|
||||
// Sebastien Pouliot <sebastien@ximian.com>
|
||||
// Sebastien Pouliot (sebastien@ximian.com)
|
||||
// sta (sta.blockhead@gmail.com)
|
||||
//
|
||||
// Copyright (c) 2004,2009 Novell, Inc (http://www.novell.com)
|
||||
// Copyright (c) 2012-2013 sta.blockhead (sta.blockhead@gmail.com)
|
||||
@@ -34,7 +35,9 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
|
||||
namespace WebSocketSharp.Net {
|
||||
|
||||
@@ -90,6 +93,16 @@ namespace WebSocketSharp.Net {
|
||||
get { return list; }
|
||||
}
|
||||
|
||||
internal IEnumerable<Cookie> Sorted {
|
||||
get {
|
||||
return from cookie in list
|
||||
orderby cookie.Version,
|
||||
cookie.Name,
|
||||
cookie.Path.Length descending
|
||||
select cookie;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Properties
|
||||
@@ -137,7 +150,7 @@ namespace WebSocketSharp.Net {
|
||||
/// A <see cref="Cookie"/> with the specified <paramref name="index"/> in the <see cref="CookieCollection"/>.
|
||||
/// </value>
|
||||
/// <param name="index">
|
||||
/// An <see cref="int"/> that is the zero-based index of the <see cref="Cookie"/> to find.
|
||||
/// An <see cref="int"/> is the zero-based index of the <see cref="Cookie"/> to find.
|
||||
/// </param>
|
||||
/// <exception cref="ArgumentOutOfRangeException">
|
||||
/// <paramref name="index"/> is less than zero or <paramref name="index"/> is greater than or
|
||||
@@ -159,7 +172,7 @@ namespace WebSocketSharp.Net {
|
||||
/// A <see cref="Cookie"/> with the specified <paramref name="name"/> in the <see cref="CookieCollection"/>.
|
||||
/// </value>
|
||||
/// <param name="name">
|
||||
/// A <see cref="string"/> that is the name of the <see cref="Cookie"/> to find.
|
||||
/// A <see cref="string"/> is the name of the <see cref="Cookie"/> to find.
|
||||
/// </param>
|
||||
/// <exception cref="ArgumentNullException">
|
||||
/// <paramref name="name"/> is <see langword="null"/>.
|
||||
@@ -170,7 +183,7 @@ namespace WebSocketSharp.Net {
|
||||
throw new ArgumentNullException ("name");
|
||||
|
||||
foreach (var cookie in list) {
|
||||
if (0 == String.Compare (cookie.Name, name, true, CultureInfo.InvariantCulture))
|
||||
if (cookie.Name.Equals (name, StringComparison.InvariantCultureIgnoreCase))
|
||||
return cookie;
|
||||
}
|
||||
|
||||
@@ -197,24 +210,179 @@ namespace WebSocketSharp.Net {
|
||||
|
||||
#region Private Method
|
||||
|
||||
static CookieCollection ParseRequest (string value)
|
||||
{
|
||||
var cookies = new CookieCollection ();
|
||||
|
||||
Cookie cookie = null;
|
||||
int version = 0;
|
||||
string [] pairs = value.Split (',', ';');
|
||||
for (int i = 0; i < pairs.Length; i++)
|
||||
{
|
||||
string pair = pairs [i].Trim ();
|
||||
if (pair.IsEmpty ())
|
||||
continue;
|
||||
|
||||
if (pair.StartsWith ("$version", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
version = Int32.Parse (pair.GetValueInternal ("=").Trim ('"'));
|
||||
}
|
||||
else if (pair.StartsWith ("$path", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!cookie.IsNull ())
|
||||
cookie.Path = pair.GetValueInternal ("=");
|
||||
}
|
||||
else if (pair.StartsWith ("$domain", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!cookie.IsNull ())
|
||||
cookie.Domain = pair.GetValueInternal ("=");
|
||||
}
|
||||
else if (pair.StartsWith ("$port", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!pair.Equals ("$port", StringComparison.InvariantCultureIgnoreCase) && !pair.EndsWith ("\"")) {
|
||||
var buffer = new StringBuilder (pair);
|
||||
string port;
|
||||
while (i < pairs.Length - 1) {
|
||||
port = pairs [++i].Trim ();
|
||||
buffer.AppendFormat (", {0}", port);
|
||||
if (port.EndsWith ("\""))
|
||||
break;
|
||||
}
|
||||
|
||||
pair = buffer.ToString ();
|
||||
}
|
||||
|
||||
if (!cookie.IsNull ())
|
||||
cookie.Port = pair.GetValueInternal ("=");
|
||||
}
|
||||
else {
|
||||
if (!cookie.IsNull ())
|
||||
cookies.Add (cookie);
|
||||
|
||||
cookie = new Cookie (pair.GetNameInternal ("="), pair.GetValueInternal ("="));
|
||||
if (version != 0)
|
||||
cookie.Version = version;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cookie.IsNull ())
|
||||
cookies.Add (cookie);
|
||||
|
||||
return cookies;
|
||||
}
|
||||
|
||||
static CookieCollection ParseResponse (string value)
|
||||
{
|
||||
var cookies = new CookieCollection ();
|
||||
|
||||
Cookie cookie = null;
|
||||
string [] pairs = value.Split (',', ';');
|
||||
for (int i = 0; i < pairs.Length; i++)
|
||||
{
|
||||
string pair = pairs [i].Trim ();
|
||||
if (pair.IsEmpty ())
|
||||
continue;
|
||||
|
||||
if (pair.StartsWith ("version", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!cookie.IsNull ())
|
||||
cookie.Version = Int32.Parse (pair.GetValueInternal ("=").Trim ('"'));
|
||||
}
|
||||
else if (pair.StartsWith ("expires", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
var buffer = new StringBuilder (pair.GetValueInternal ("="));
|
||||
if (i < pairs.Length - 1)
|
||||
buffer.AppendFormat (", {0}", pairs [++i].Trim ());
|
||||
|
||||
DateTime expires;
|
||||
if (!DateTime.TryParseExact (buffer.ToString (),
|
||||
new string [] { "ddd, dd'-'MMM'-'yyyy HH':'mm':'ss 'GMT'", "r" },
|
||||
CultureInfo.CreateSpecificCulture("en-US"),
|
||||
DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal,
|
||||
out expires))
|
||||
expires = DateTime.Now;
|
||||
|
||||
if (!cookie.IsNull () && cookie.Expires == DateTime.MinValue)
|
||||
cookie.Expires = expires.ToLocalTime ();
|
||||
}
|
||||
else if (pair.StartsWith ("max-age", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
int max = Int32.Parse (pair.GetValueInternal ("=").Trim ('"'));
|
||||
var expires = DateTime.Now.AddSeconds ((double) max);
|
||||
if (!cookie.IsNull ())
|
||||
cookie.Expires = expires;
|
||||
}
|
||||
else if (pair.StartsWith ("path", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!cookie.IsNull ())
|
||||
cookie.Path = pair.GetValueInternal ("=");
|
||||
}
|
||||
else if (pair.StartsWith ("domain", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!cookie.IsNull ())
|
||||
cookie.Domain = pair.GetValueInternal ("=");
|
||||
}
|
||||
else if (pair.StartsWith ("port", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!pair.Equals ("port", StringComparison.InvariantCultureIgnoreCase) && !pair.EndsWith ("\"")) {
|
||||
var buffer = new StringBuilder (pair);
|
||||
string port;
|
||||
while (i < pairs.Length - 1) {
|
||||
port = pairs [++i].Trim ();
|
||||
buffer.AppendFormat (", {0}", port);
|
||||
if (port.EndsWith ("\""))
|
||||
break;
|
||||
}
|
||||
|
||||
pair = buffer.ToString ();
|
||||
}
|
||||
|
||||
if (!cookie.IsNull ())
|
||||
cookie.Port = pair.GetValueInternal ("=");
|
||||
}
|
||||
else if (pair.StartsWith ("comment", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!cookie.IsNull ())
|
||||
cookie.Comment = pair.GetValueInternal ("=").UrlDecode ();
|
||||
}
|
||||
else if (pair.StartsWith ("commenturl", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!cookie.IsNull ())
|
||||
cookie.CommentUri = pair.GetValueInternal ("=").Trim ('"').ToUri ();
|
||||
}
|
||||
else if (pair.StartsWith ("discard", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!cookie.IsNull ())
|
||||
cookie.Discard = true;
|
||||
}
|
||||
else if (pair.StartsWith ("secure", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!cookie.IsNull ())
|
||||
cookie.Secure = true;
|
||||
}
|
||||
else if (pair.StartsWith ("httponly", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
if (!cookie.IsNull ())
|
||||
cookie.HttpOnly = true;
|
||||
}
|
||||
else {
|
||||
if (!cookie.IsNull ())
|
||||
cookies.Add (cookie);
|
||||
|
||||
cookie = new Cookie (pair.GetNameInternal ("="), pair.GetValueInternal ("="));
|
||||
}
|
||||
}
|
||||
|
||||
if (!cookie.IsNull ())
|
||||
cookies.Add (cookie);
|
||||
|
||||
return cookies;
|
||||
}
|
||||
|
||||
int SearchCookie (Cookie cookie)
|
||||
{
|
||||
string name = cookie.Name;
|
||||
string domain = cookie.Domain;
|
||||
string path = cookie.Path;
|
||||
string domain = cookie.Domain;
|
||||
int version = cookie.Version;
|
||||
|
||||
for (int i = list.Count - 1; i >= 0; i--) {
|
||||
Cookie c = list [i];
|
||||
if (0 != String.Compare (name, c.Name, true, CultureInfo.InvariantCulture))
|
||||
if (!c.Name.Equals (name, StringComparison.InvariantCultureIgnoreCase))
|
||||
continue;
|
||||
|
||||
if (0 != String.Compare (domain, c.Domain, true, CultureInfo.InvariantCulture))
|
||||
if (!c.Path.Equals (path, StringComparison.InvariantCulture))
|
||||
continue;
|
||||
|
||||
if (0 != String.Compare (path, c.Path, false, CultureInfo.InvariantCulture))
|
||||
if (!c.Domain.Equals (domain, StringComparison.InvariantCultureIgnoreCase))
|
||||
continue;
|
||||
|
||||
if (c.Version != cookie.Version)
|
||||
if (c.Version != version)
|
||||
continue;
|
||||
|
||||
return i;
|
||||
@@ -227,6 +395,34 @@ namespace WebSocketSharp.Net {
|
||||
|
||||
#region Internal Method
|
||||
|
||||
internal static CookieCollection Parse (string value, bool response)
|
||||
{
|
||||
return response
|
||||
? ParseResponse (value)
|
||||
: ParseRequest (value);
|
||||
}
|
||||
|
||||
internal void SetOrRemove (Cookie cookie)
|
||||
{
|
||||
int pos = SearchCookie (cookie);
|
||||
if (pos == -1) {
|
||||
if (!cookie.Expired)
|
||||
list.Add (cookie);
|
||||
}
|
||||
else {
|
||||
if (!cookie.Expired)
|
||||
list [pos] = cookie;
|
||||
else
|
||||
list.RemoveAt (pos);
|
||||
}
|
||||
}
|
||||
|
||||
internal void SetOrRemove (CookieCollection cookies)
|
||||
{
|
||||
foreach (Cookie cookie in cookies)
|
||||
SetOrRemove (cookie);
|
||||
}
|
||||
|
||||
internal void Sort ()
|
||||
{
|
||||
if (list.Count > 0)
|
||||
@@ -281,7 +477,7 @@ namespace WebSocketSharp.Net {
|
||||
/// starting at the specified <paramref name="index"/> in the <paramref name="array"/>.
|
||||
/// </summary>
|
||||
/// <param name="array">
|
||||
/// An <see cref="Array"/> that is the destination of the elements copied from the <see cref="CookieCollection"/>.
|
||||
/// An <see cref="Array"/> is the destination of the elements copied from the <see cref="CookieCollection"/>.
|
||||
/// </param>
|
||||
/// <param name="index">
|
||||
/// An <see cref="int"/> that indicates the zero-based index in <paramref name="array"/> at which copying begins.
|
||||
@@ -292,6 +488,22 @@ namespace WebSocketSharp.Net {
|
||||
/// <exception cref="ArgumentOutOfRangeException">
|
||||
/// <paramref name="index"/> is less than zero.
|
||||
/// </exception>
|
||||
/// <exception cref="ArgumentException">
|
||||
/// <para>
|
||||
/// <paramref name="array"/> is multidimensional.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// -or-
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The number of elements in the <see cref="CookieCollection"/> is greater than the available space
|
||||
/// from index to the end of the destination <paramref name="array"/>.
|
||||
/// </para>
|
||||
/// </exception>
|
||||
/// <exception cref="InvalidCastException">
|
||||
/// The elements in the <see cref="CookieCollection"/> cannot be cast automatically
|
||||
/// to the type of the destination <paramref name="array"/>.
|
||||
/// </exception>
|
||||
public void CopyTo (Array array, int index)
|
||||
{
|
||||
if (array.IsNull ())
|
||||
@@ -300,7 +512,16 @@ namespace WebSocketSharp.Net {
|
||||
if (index < 0)
|
||||
throw new ArgumentOutOfRangeException ("index", "Must not be less than zero.");
|
||||
|
||||
// TODO: Support for ArgumentException and InvalidCastException.
|
||||
if (array.Rank > 1)
|
||||
throw new ArgumentException ("Must not be multidimensional.", "array");
|
||||
|
||||
if (array.Length - index < list.Count)
|
||||
throw new ArgumentException (
|
||||
"The number of elements in this collection is greater than the available space of the destination array.");
|
||||
|
||||
if (!array.GetType ().GetElementType ().IsAssignableFrom (typeof (Cookie)))
|
||||
throw new InvalidCastException (
|
||||
"The elements in this collection cannot be cast automatically to the type of the destination array.");
|
||||
|
||||
(list as IList).CopyTo (array, index);
|
||||
}
|
||||
@@ -310,7 +531,7 @@ namespace WebSocketSharp.Net {
|
||||
/// starting at the specified <paramref name="index"/> in the <paramref name="array"/>.
|
||||
/// </summary>
|
||||
/// <param name="array">
|
||||
/// An array of <see cref="Cookie"/> that is the destination of the elements copied from the <see cref="CookieCollection"/>.
|
||||
/// An array of <see cref="Cookie"/> is the destination of the elements copied from the <see cref="CookieCollection"/>.
|
||||
/// </param>
|
||||
/// <param name="index">
|
||||
/// An <see cref="int"/> that indicates the zero-based index in <paramref name="array"/> at which copying begins.
|
||||
@@ -321,6 +542,10 @@ namespace WebSocketSharp.Net {
|
||||
/// <exception cref="ArgumentOutOfRangeException">
|
||||
/// <paramref name="index"/> is less than zero.
|
||||
/// </exception>
|
||||
/// <exception cref="ArgumentException">
|
||||
/// The number of elements in the <see cref="CookieCollection"/> is greater than the available space
|
||||
/// from index to the end of the destination <paramref name="array"/>.
|
||||
/// </exception>
|
||||
public void CopyTo (Cookie [] array, int index)
|
||||
{
|
||||
if (array.IsNull ())
|
||||
@@ -329,7 +554,9 @@ namespace WebSocketSharp.Net {
|
||||
if (index < 0)
|
||||
throw new ArgumentOutOfRangeException ("index", "Must not be less than zero.");
|
||||
|
||||
// TODO: Support for ArgumentException.
|
||||
if (array.Length - index < list.Count)
|
||||
throw new ArgumentException (
|
||||
"The number of elements in this collection is greater than the available space of the destination array.");
|
||||
|
||||
list.CopyTo (array, index);
|
||||
}
|
||||
|
@@ -555,7 +555,7 @@ namespace WebSocketSharp.Net {
|
||||
|
||||
if (cookies != null) {
|
||||
foreach (Cookie cookie in cookies)
|
||||
headers.SetInternal ("Set-Cookie", cookie.ToClientString (), true);
|
||||
headers.SetInternal ("Set-Cookie", cookie.ToResponseString (), true);
|
||||
}
|
||||
|
||||
StreamWriter writer = new StreamWriter (ms, encoding, 256);
|
||||
|
@@ -43,6 +43,7 @@ namespace WebSocketSharp.Net.WebSockets {
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private CookieCollection _cookies;
|
||||
private TcpClient _tcpClient;
|
||||
private bool _isSecure;
|
||||
private RequestHandshake _request;
|
||||
@@ -80,14 +81,14 @@ namespace WebSocketSharp.Net.WebSockets {
|
||||
/// Gets the cookies used in the WebSocket opening handshake.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// A <see cref="WebSocketSharp.Net.CookieCollection"/> that contains the cookies.
|
||||
/// A <see cref="CookieCollection"/> that contains the cookies.
|
||||
/// </value>
|
||||
/// <exception cref="NotImplementedException">
|
||||
/// This property is not implemented.
|
||||
/// </exception>
|
||||
public override CookieCollection CookieCollection {
|
||||
get {
|
||||
throw new NotImplementedException();
|
||||
if (_cookies.IsNull())
|
||||
_cookies = _request.Cookies;
|
||||
|
||||
return _cookies;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,6 +28,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using WebSocketSharp.Net;
|
||||
using WebSocketSharp.Net.WebSockets;
|
||||
@@ -65,6 +66,12 @@ namespace WebSocketSharp {
|
||||
|
||||
#region Properties
|
||||
|
||||
public CookieCollection Cookies {
|
||||
get {
|
||||
return Headers.GetCookies(false);
|
||||
}
|
||||
}
|
||||
|
||||
public string HttpMethod { get; private set; }
|
||||
|
||||
public bool IsWebSocketRequest {
|
||||
@@ -148,7 +155,7 @@ namespace WebSocketSharp {
|
||||
|
||||
var headers = new WebHeaderCollection();
|
||||
for (int i = 1; i < request.Length; i++)
|
||||
headers.SetInternal (request[i], false);
|
||||
headers.SetInternal(request[i], false);
|
||||
|
||||
return new RequestHandshake {
|
||||
Headers = headers,
|
||||
@@ -162,6 +169,20 @@ namespace WebSocketSharp {
|
||||
|
||||
#region Public Method
|
||||
|
||||
public void SetCookies(CookieCollection cookies)
|
||||
{
|
||||
if (cookies.IsNull() || cookies.Count == 0)
|
||||
return;
|
||||
|
||||
var sorted = cookies.Sorted.ToArray();
|
||||
var header = new StringBuilder(sorted[0].ToString());
|
||||
for (int i = 1; i < sorted.Length; i++)
|
||||
if (!sorted[i].Expired)
|
||||
header.AppendFormat("; {0}", sorted[i].ToString());
|
||||
|
||||
AddHeader("Cookie", header.ToString());
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var buffer = new StringBuilder();
|
||||
|
@@ -54,6 +54,12 @@ namespace WebSocketSharp {
|
||||
|
||||
#region Properties
|
||||
|
||||
public CookieCollection Cookies {
|
||||
get {
|
||||
return Headers.GetCookies(true);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsWebSocketResponse {
|
||||
get {
|
||||
return ProtocolVersion < HttpVersion.Version11
|
||||
@@ -96,7 +102,7 @@ namespace WebSocketSharp {
|
||||
|
||||
var headers = new WebHeaderCollection();
|
||||
for (int i = 1; i < response.Length; i++)
|
||||
headers.SetInternal (response[i], true);
|
||||
headers.SetInternal(response[i], true);
|
||||
|
||||
return new ResponseHandshake {
|
||||
Headers = headers,
|
||||
@@ -106,6 +112,15 @@ namespace WebSocketSharp {
|
||||
};
|
||||
}
|
||||
|
||||
public void SetCookies(CookieCollection cookies)
|
||||
{
|
||||
if (cookies.IsNull() || cookies.Count == 0)
|
||||
return;
|
||||
|
||||
foreach (var cookie in cookies.Sorted)
|
||||
AddHeader("Set-Cookie", cookie.ToResponseString());
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var buffer = new StringBuilder();
|
||||
|
@@ -30,6 +30,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Threading;
|
||||
using WebSocketSharp.Net;
|
||||
using WebSocketSharp.Net.WebSockets;
|
||||
|
||||
namespace WebSocketSharp.Server {
|
||||
@@ -148,8 +149,14 @@ namespace WebSocketSharp.Server {
|
||||
if (IsBound)
|
||||
return;
|
||||
|
||||
_context = context;
|
||||
_sessions = sessions;
|
||||
if (!ProcessCookies(context.CookieCollection, context.WebSocket.CookieCollection))
|
||||
{
|
||||
context.WebSocket.Close(HttpStatusCode.BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
_context = context;
|
||||
_sessions = sessions;
|
||||
_websocket = context.WebSocket;
|
||||
|
||||
_websocket.OnOpen += onOpen;
|
||||
@@ -211,6 +218,23 @@ namespace WebSocketSharp.Server {
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes the cookies used in the WebSocket opening handshake.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// <c>true</c> if processing the cookies is successfully; otherwise, <c>false</c>.
|
||||
/// </returns>
|
||||
/// <param name="request">
|
||||
/// A <see cref="CookieCollection"/> that contains a collection of the HTTP Cookies received from the client.
|
||||
/// </param>
|
||||
/// <param name="response">
|
||||
/// A <see cref="CookieCollection"/> that contains a collection of the HTTP Cookies to send to the client.
|
||||
/// </param>
|
||||
protected virtual bool ProcessCookies(CookieCollection request, CookieCollection response)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
@@ -67,6 +67,7 @@ namespace WebSocketSharp {
|
||||
private string _base64key;
|
||||
private bool _client;
|
||||
private Action _closeContext;
|
||||
private CookieCollection _cookies;
|
||||
private WebSocketContext _context;
|
||||
private string _extensions;
|
||||
private AutoResetEvent _exitReceiving;
|
||||
@@ -87,6 +88,7 @@ namespace WebSocketSharp {
|
||||
|
||||
private WebSocket()
|
||||
{
|
||||
_cookies = new CookieCollection();
|
||||
_extensions = String.Empty;
|
||||
_forClose = new Object();
|
||||
_forSend = new Object();
|
||||
@@ -206,8 +208,35 @@ namespace WebSocketSharp {
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Property
|
||||
|
||||
internal CookieCollection CookieCollection {
|
||||
get {
|
||||
return _cookies;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets the cookies used in the WebSocket opening handshake.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// An IEnumerable<Cookie> interface that provides an enumerator which supports the iteration
|
||||
/// over the collection of cookies.
|
||||
/// </value>
|
||||
public IEnumerable<Cookie> Cookies {
|
||||
get {
|
||||
lock (_cookies.SyncRoot)
|
||||
{
|
||||
return from Cookie cookie in _cookies
|
||||
select cookie;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the extensions selected by the server.
|
||||
/// </summary>
|
||||
@@ -492,6 +521,8 @@ namespace WebSocketSharp {
|
||||
if (!_protocols.IsNullOrEmpty())
|
||||
req.AddHeader("Sec-WebSocket-Protocol", _protocols);
|
||||
req.AddHeader("Sec-WebSocket-Version", _version);
|
||||
if (_cookies.Count > 0)
|
||||
req.SetCookies(_cookies);
|
||||
|
||||
return req;
|
||||
}
|
||||
@@ -501,6 +532,8 @@ namespace WebSocketSharp {
|
||||
{
|
||||
var res = new ResponseHandshake();
|
||||
res.AddHeader("Sec-WebSocket-Accept", createResponseKey());
|
||||
if (_cookies.Count > 0)
|
||||
res.SetCookies(_cookies);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -852,6 +885,9 @@ namespace WebSocketSharp {
|
||||
if (res.HeaderExists("Sec-WebSocket-Extensions"))
|
||||
_extensions = res.Headers["Sec-WebSocket-Extensions"];
|
||||
|
||||
if (res.Cookies.Count > 0)
|
||||
_cookies.SetOrRemove(res.Cookies);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1353,6 +1389,32 @@ namespace WebSocketSharp {
|
||||
sendAsync(Opcode.BINARY, file.OpenRead(), completed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets a <see cref="Cookie"/> used in the WebSocket opening handshake.
|
||||
/// </summary>
|
||||
/// <param name="cookie">
|
||||
/// A <see cref="Cookie"/> that contains an HTTP Cookie to set.
|
||||
/// </param>
|
||||
public void SetCookie(Cookie cookie)
|
||||
{
|
||||
var msg = _readyState == WsState.OPEN
|
||||
? "The WebSocket connection has been established already."
|
||||
: cookie.IsNull()
|
||||
? "'cookie' must not be null."
|
||||
: String.Empty;
|
||||
|
||||
if (!msg.IsEmpty())
|
||||
{
|
||||
onError(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
lock (_cookies.SyncRoot)
|
||||
{
|
||||
_cookies.SetOrRemove(cookie);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -152,6 +152,21 @@
|
||||
A <see cref="T:System.Uri" /> that contains the URI to get the absolute path from.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:WebSocketSharp.Ext.GetCookies(System.Collections.Specialized.NameValueCollection,System.Boolean)">
|
||||
<summary>
|
||||
Gets the collection of cookies from the specified <see cref="T:System.Collections.Specialized.NameValueCollection" />.
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:WebSocketSharp.Net.CookieCollection" /> that receives a collection of the HTTP Cookies.
|
||||
</returns>
|
||||
<param name="headers">
|
||||
A <see cref="T:System.Collections.Specialized.NameValueCollection" /> that contains a collection of the HTTP Headers.
|
||||
</param>
|
||||
<param name="response">
|
||||
<c>true</c> if gets from the response <paramref name="headers" />;
|
||||
from the request <paramref name="headers" />, <c>false</c>.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:WebSocketSharp.Ext.GetDescription(WebSocketSharp.Net.HttpStatusCode)">
|
||||
<summary>
|
||||
Gets the description of the HTTP status code using the specified <see cref="T:WebSocketSharp.Net.HttpStatusCode" />.
|
||||
@@ -928,6 +943,15 @@
|
||||
Occurs when the WebSocket connection has been established.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WebSocketSharp.WebSocket.Cookies">
|
||||
<summary>
|
||||
Gets the cookies used in the WebSocket opening handshake.
|
||||
</summary>
|
||||
<value>
|
||||
An IEnumerable<Cookie> interface that provides an enumerator which supports the iteration
|
||||
over the collection of cookies.
|
||||
</value>
|
||||
</member>
|
||||
<member name="P:WebSocketSharp.WebSocket.Extensions">
|
||||
<summary>
|
||||
Gets the extensions selected by the server.
|
||||
@@ -1123,6 +1147,14 @@
|
||||
the asynchronous operation completes.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:WebSocketSharp.WebSocket.SetCookie(WebSocketSharp.Net.Cookie)">
|
||||
<summary>
|
||||
Sets a <see cref="T:WebSocketSharp.Net.Cookie" /> used in the WebSocket opening handshake.
|
||||
</summary>
|
||||
<param name="cookie">
|
||||
A <see cref="T:WebSocketSharp.Net.Cookie" /> that contains an HTTP Cookie to set.
|
||||
</param>
|
||||
</member>
|
||||
<member name="T:WebSocketSharp.Server.WebSocketServer">
|
||||
<summary>
|
||||
Provides the functions of the server that receives the WebSocket connection requests.
|
||||
@@ -1316,6 +1348,20 @@
|
||||
Occurs when the WebSocket connection has been established.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WebSocketSharp.Server.WebSocketService.ProcessCookies(WebSocketSharp.Net.CookieCollection,WebSocketSharp.Net.CookieCollection)">
|
||||
<summary>
|
||||
Processes the cookies used in the WebSocket opening handshake.
|
||||
</summary>
|
||||
<returns>
|
||||
<c>true</c> if processing the cookies is successfully; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<param name="request">
|
||||
A <see cref="T:WebSocketSharp.Net.CookieCollection" /> that contains a collection of the HTTP Cookies received from the client.
|
||||
</param>
|
||||
<param name="response">
|
||||
A <see cref="T:WebSocketSharp.Net.CookieCollection" /> that contains a collection of the HTTP Cookies to send to the client.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:WebSocketSharp.Server.WebSocketService.Broadcast(System.Byte[])">
|
||||
<summary>
|
||||
Broadcasts the specified array of <see cref="T:System.Byte" /> to the clients of every <see cref="T:WebSocketSharp.Server.WebSocketService" /> instances
|
||||
@@ -1697,7 +1743,7 @@
|
||||
Gets or sets a value indicating whether the cookie has expired.
|
||||
</summary>
|
||||
<value>
|
||||
<c>true</c> if the cookie has expired; otherwise, <c>false</c>.
|
||||
<c>true</c> if the cookie has expired; otherwise, <c>false</c>. The default is <c>false</c>.
|
||||
</value>
|
||||
</member>
|
||||
<member name="P:WebSocketSharp.Net.Cookie.Expires">
|
||||
@@ -1706,6 +1752,7 @@
|
||||
</summary>
|
||||
<value>
|
||||
A <see cref="T:System.DateTime" /> that contains the date and time at which the cookie expires.
|
||||
The default is <see cref="F:System.DateTime.MinValue" />.
|
||||
</value>
|
||||
</member>
|
||||
<member name="P:WebSocketSharp.Net.Cookie.HttpOnly">
|
||||
@@ -1752,7 +1799,7 @@
|
||||
A <see cref="T:System.String" /> that contains a list of the TCP ports to which the cookie applies.
|
||||
</value>
|
||||
<exception cref="T:WebSocketSharp.Net.CookieException">
|
||||
The value specified for a set operation could not be parsed or is not enclosed in double quotes.
|
||||
The value specified for a set operation is not enclosed in double quotes or could not be parsed.
|
||||
</exception>
|
||||
</member>
|
||||
<member name="P:WebSocketSharp.Net.Cookie.Secure">
|
||||
@@ -1793,7 +1840,7 @@
|
||||
to which the cookie conforms.
|
||||
</value>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">
|
||||
The value specified for a set operation is less than zero.
|
||||
The value specified for a set operation is not allowed. The value must be 0 or 1.
|
||||
</exception>
|
||||
</member>
|
||||
<member name="M:WebSocketSharp.Net.Cookie.Equals(System.Object)">
|
||||
@@ -1845,7 +1892,7 @@
|
||||
A <see cref="T:WebSocketSharp.Net.Cookie" /> with the specified <paramref name="index" /> in the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
</value>
|
||||
<param name="index">
|
||||
An <see cref="T:System.Int32" /> that is the zero-based index of the <see cref="T:WebSocketSharp.Net.Cookie" /> to find.
|
||||
An <see cref="T:System.Int32" /> is the zero-based index of the <see cref="T:WebSocketSharp.Net.Cookie" /> to find.
|
||||
</param>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">
|
||||
<paramref name="index" /> is less than zero or <paramref name="index" /> is greater than or
|
||||
@@ -1860,7 +1907,7 @@
|
||||
A <see cref="T:WebSocketSharp.Net.Cookie" /> with the specified <paramref name="name" /> in the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
</value>
|
||||
<param name="name">
|
||||
A <see cref="T:System.String" /> that is the name of the <see cref="T:WebSocketSharp.Net.Cookie" /> to find.
|
||||
A <see cref="T:System.String" /> is the name of the <see cref="T:WebSocketSharp.Net.Cookie" /> to find.
|
||||
</param>
|
||||
<exception cref="T:System.ArgumentNullException">
|
||||
<paramref name="name" /> is <see langword="null" />.
|
||||
@@ -1928,7 +1975,7 @@
|
||||
starting at the specified <paramref name="index" /> in the <paramref name="array" />.
|
||||
</summary>
|
||||
<param name="array">
|
||||
An <see cref="T:System.Array" /> that is the destination of the elements copied from the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
An <see cref="T:System.Array" /> is the destination of the elements copied from the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
</param>
|
||||
<param name="index">
|
||||
An <see cref="T:System.Int32" /> that indicates the zero-based index in <paramref name="array" /> at which copying begins.
|
||||
@@ -1939,6 +1986,22 @@
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">
|
||||
<paramref name="index" /> is less than zero.
|
||||
</exception>
|
||||
<exception cref="T:System.ArgumentException">
|
||||
<para>
|
||||
<paramref name="array" /> is multidimensional.
|
||||
</para>
|
||||
<para>
|
||||
-or-
|
||||
</para>
|
||||
<para>
|
||||
The number of elements in the <see cref="T:WebSocketSharp.Net.CookieCollection" /> is greater than the available space
|
||||
from index to the end of the destination <paramref name="array" />.
|
||||
</para>
|
||||
</exception>
|
||||
<exception cref="T:System.InvalidCastException">
|
||||
The elements in the <see cref="T:WebSocketSharp.Net.CookieCollection" /> cannot be cast automatically
|
||||
to the type of the destination <paramref name="array" />.
|
||||
</exception>
|
||||
</member>
|
||||
<member name="M:WebSocketSharp.Net.CookieCollection.CopyTo(WebSocketSharp.Net.Cookie[],System.Int32)">
|
||||
<summary>
|
||||
@@ -1946,7 +2009,7 @@
|
||||
starting at the specified <paramref name="index" /> in the <paramref name="array" />.
|
||||
</summary>
|
||||
<param name="array">
|
||||
An array of <see cref="T:WebSocketSharp.Net.Cookie" /> that is the destination of the elements copied from the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
An array of <see cref="T:WebSocketSharp.Net.Cookie" /> is the destination of the elements copied from the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
</param>
|
||||
<param name="index">
|
||||
An <see cref="T:System.Int32" /> that indicates the zero-based index in <paramref name="array" /> at which copying begins.
|
||||
@@ -1957,6 +2020,10 @@
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">
|
||||
<paramref name="index" /> is less than zero.
|
||||
</exception>
|
||||
<exception cref="T:System.ArgumentException">
|
||||
The number of elements in the <see cref="T:WebSocketSharp.Net.CookieCollection" /> is greater than the available space
|
||||
from index to the end of the destination <paramref name="array" />.
|
||||
</exception>
|
||||
</member>
|
||||
<member name="M:WebSocketSharp.Net.CookieCollection.GetEnumerator">
|
||||
<summary>
|
||||
@@ -4652,9 +4719,6 @@
|
||||
<value>
|
||||
A <see cref="T:WebSocketSharp.Net.CookieCollection" /> that contains the cookies.
|
||||
</value>
|
||||
<exception cref="T:System.NotImplementedException">
|
||||
This property is not implemented.
|
||||
</exception>
|
||||
</member>
|
||||
<member name="P:WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext.Headers">
|
||||
<summary>
|
||||
|
@@ -991,7 +991,7 @@
|
||||
<div class="Signature">public <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean">bool</a> <b>Expired</b> { get; set; }</div>
|
||||
<h4 class="Subsection">Value</h4>
|
||||
<blockquote class="SubsectionBox" id="P:WebSocketSharp.Net.Cookie.Expired:Value">
|
||||
<tt>true</tt> if the cookie has expired; otherwise, <tt>false</tt>.
|
||||
<tt>true</tt> if the cookie has expired; otherwise, <tt>false</tt>. The default is <tt>false</tt>.
|
||||
</blockquote>
|
||||
<h2 class="Section">Remarks</h2>
|
||||
<div class="SectionBox" id="P:WebSocketSharp.Net.Cookie.Expired:Remarks">
|
||||
@@ -1012,6 +1012,7 @@
|
||||
<h4 class="Subsection">Value</h4>
|
||||
<blockquote class="SubsectionBox" id="P:WebSocketSharp.Net.Cookie.Expires:Value">
|
||||
A <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.DateTime">DateTime</a> that contains the date and time at which the cookie expires.
|
||||
The default is <a href="http://www.go-mono.com/docs/monodoc.ashx?link=F:System.DateTime.MinValue">DateTime.MinValue</a>.
|
||||
</blockquote>
|
||||
<h2 class="Section">Remarks</h2>
|
||||
<div class="SectionBox" id="P:WebSocketSharp.Net.Cookie.Expires:Remarks">
|
||||
@@ -1151,7 +1152,7 @@
|
||||
<a href="../WebSocketSharp.Net/CookieException.html">WebSocketSharp.Net.CookieException</a>
|
||||
</td>
|
||||
<td>
|
||||
The value specified for a set operation could not be parsed or is not enclosed in double quotes.
|
||||
The value specified for a set operation is not enclosed in double quotes or could not be parsed.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1271,7 +1272,7 @@
|
||||
<a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.ArgumentOutOfRangeException">ArgumentOutOfRangeException</a>
|
||||
</td>
|
||||
<td>
|
||||
The value specified for a set operation is less than zero.
|
||||
The value specified for a set operation is not allowed. The value must be 0 or 1.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@@ -561,7 +561,7 @@
|
||||
<i>array</i>
|
||||
</dt>
|
||||
<dd>
|
||||
An <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Array">Array</a> that is the destination of the elements copied from the <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a>.
|
||||
An <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Array">Array</a> is the destination of the elements copied from the <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a>.
|
||||
</dd>
|
||||
<dt>
|
||||
<i>index</i>
|
||||
@@ -592,6 +592,32 @@
|
||||
</td>
|
||||
<td>
|
||||
<i>index</i> is less than zero.
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.ArgumentException">ArgumentException</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<i>array</i> is multidimensional.
|
||||
</p>
|
||||
<p>
|
||||
-or-
|
||||
</p>
|
||||
<p>
|
||||
The number of elements in the <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a> is greater than the available space
|
||||
from index to the end of the destination <i>array</i>.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.InvalidCastException">InvalidCastException</a>
|
||||
</td>
|
||||
<td>
|
||||
The elements in the <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a> cannot be cast automatically
|
||||
to the type of the destination <i>array</i>.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -620,7 +646,7 @@
|
||||
<i>array</i>
|
||||
</dt>
|
||||
<dd>
|
||||
An array of <a href="../WebSocketSharp.Net/Cookie.html">WebSocketSharp.Net.Cookie</a> that is the destination of the elements copied from the <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a>.
|
||||
An array of <a href="../WebSocketSharp.Net/Cookie.html">WebSocketSharp.Net.Cookie</a> is the destination of the elements copied from the <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a>.
|
||||
</dd>
|
||||
<dt>
|
||||
<i>index</i>
|
||||
@@ -651,6 +677,15 @@
|
||||
</td>
|
||||
<td>
|
||||
<i>index</i> is less than zero.
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.ArgumentException">ArgumentException</a>
|
||||
</td>
|
||||
<td>
|
||||
The number of elements in the <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a> is greater than the available space
|
||||
from index to the end of the destination <i>array</i>.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -764,7 +799,7 @@
|
||||
<i>index</i>
|
||||
</dt>
|
||||
<dd>
|
||||
An <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Int32">int</a> that is the zero-based index of the <a href="../WebSocketSharp.Net/Cookie.html">WebSocketSharp.Net.Cookie</a> to find.
|
||||
An <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Int32">int</a> is the zero-based index of the <a href="../WebSocketSharp.Net/Cookie.html">WebSocketSharp.Net.Cookie</a> to find.
|
||||
</dd>
|
||||
</dl>
|
||||
</blockquote>
|
||||
@@ -816,7 +851,7 @@
|
||||
<i>name</i>
|
||||
</dt>
|
||||
<dd>
|
||||
A <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a> that is the name of the <a href="../WebSocketSharp.Net/Cookie.html">WebSocketSharp.Net.Cookie</a> to find.
|
||||
A <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a> is the name of the <a href="../WebSocketSharp.Net/Cookie.html">WebSocketSharp.Net.Cookie</a> to find.
|
||||
</dd>
|
||||
</dl>
|
||||
</blockquote>
|
||||
|
@@ -576,6 +576,18 @@
|
||||
<a href="#M:WebSocketSharp.Server.WebSocketService.OnOpen">OnOpen</a>
|
||||
</b>()<blockquote>
|
||||
Occurs when the WebSocket connection has been established.
|
||||
</blockquote></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<div>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<b>
|
||||
<a href="#M:WebSocketSharp.Server.WebSocketService.ProcessCookies(WebSocketSharp.Net.CookieCollection,WebSocketSharp.Net.CookieCollection)">ProcessCookies</a>
|
||||
</b>(<a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a>, <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean">bool</a></nobr><blockquote>
|
||||
Processes the cookies used in the WebSocket opening handshake.
|
||||
</blockquote></td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1001,6 +1013,43 @@
|
||||
<b>Namespace: </b>WebSocketSharp.Server<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
||||
<hr size="1" />
|
||||
</blockquote>
|
||||
<h3 id="M:WebSocketSharp.Server.WebSocketService.ProcessCookies(WebSocketSharp.Net.CookieCollection,WebSocketSharp.Net.CookieCollection)">ProcessCookies Method</h3>
|
||||
<blockquote id="M:WebSocketSharp.Server.WebSocketService.ProcessCookies(WebSocketSharp.Net.CookieCollection,WebSocketSharp.Net.CookieCollection):member">
|
||||
<p class="Summary">
|
||||
Processes the cookies used in the WebSocket opening handshake.
|
||||
</p>
|
||||
<h2>Syntax</h2>
|
||||
<div class="Signature">protected virtual <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean">bool</a> <b>ProcessCookies</b> (<a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a> request, <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a> response)</div>
|
||||
<h4 class="Subsection">Parameters</h4>
|
||||
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Server.WebSocketService.ProcessCookies(WebSocketSharp.Net.CookieCollection,WebSocketSharp.Net.CookieCollection):Parameters">
|
||||
<dl>
|
||||
<dt>
|
||||
<i>request</i>
|
||||
</dt>
|
||||
<dd>
|
||||
A <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a> that contains a collection of the HTTP Cookies received from the client.
|
||||
</dd>
|
||||
<dt>
|
||||
<i>response</i>
|
||||
</dt>
|
||||
<dd>
|
||||
A <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a> that contains a collection of the HTTP Cookies to send to the client.
|
||||
</dd>
|
||||
</dl>
|
||||
</blockquote>
|
||||
<h4 class="Subsection">Returns</h4>
|
||||
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Server.WebSocketService.ProcessCookies(WebSocketSharp.Net.CookieCollection,WebSocketSharp.Net.CookieCollection):Returns">
|
||||
<tt>true</tt> if processing the cookies is successfully; otherwise, <tt>false</tt>.
|
||||
</blockquote>
|
||||
<h2 class="Section">Remarks</h2>
|
||||
<div class="SectionBox" id="M:WebSocketSharp.Server.WebSocketService.ProcessCookies(WebSocketSharp.Net.CookieCollection,WebSocketSharp.Net.CookieCollection):Remarks">
|
||||
<span class="NotEntered">Documentation for this section has not yet been entered.</span>
|
||||
</div>
|
||||
<h2 class="Section">Requirements</h2>
|
||||
<div class="SectionBox" id="M:WebSocketSharp.Server.WebSocketService.ProcessCookies(WebSocketSharp.Net.CookieCollection,WebSocketSharp.Net.CookieCollection):Version Information">
|
||||
<b>Namespace: </b>WebSocketSharp.Server<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
||||
<hr size="1" />
|
||||
</blockquote>
|
||||
<h3 id="P:WebSocketSharp.Server.WebSocketService.QueryString">QueryString Property</h3>
|
||||
<blockquote id="P:WebSocketSharp.Server.WebSocketService.QueryString:member">
|
||||
<p class="Summary">
|
||||
|
@@ -330,6 +330,17 @@
|
||||
<a href="#M:WebSocketSharp.Ext.GetAbsolutePath(System.Uri)">GetAbsolutePath</a>
|
||||
</b>(<i>this</i> <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Uri">Uri</a>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a></nobr><blockquote>
|
||||
Gets the absolute path from the specified <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Uri">Uri</a>.
|
||||
</blockquote></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<div>static </div>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<b>
|
||||
<a href="#M:WebSocketSharp.Ext.GetCookies(System.Collections.Specialized.NameValueCollection,System.Boolean)">GetCookies</a>
|
||||
</b>(<i>this</i> <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Specialized.NameValueCollection">System.Collections.Specialized.NameValueCollection</a>, <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean">bool</a>)<nobr> : <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a></nobr><blockquote>
|
||||
Gets the collection of cookies from the specified <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Specialized.NameValueCollection">System.Collections.Specialized.NameValueCollection</a>.
|
||||
</blockquote></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
@@ -1182,6 +1193,44 @@
|
||||
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
||||
<hr size="1" />
|
||||
</blockquote>
|
||||
<h3 id="M:WebSocketSharp.Ext.GetCookies(System.Collections.Specialized.NameValueCollection,System.Boolean)">GetCookies Method</h3>
|
||||
<blockquote id="M:WebSocketSharp.Ext.GetCookies(System.Collections.Specialized.NameValueCollection,System.Boolean):member">
|
||||
<p class="Summary">
|
||||
Gets the collection of cookies from the specified <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Specialized.NameValueCollection">System.Collections.Specialized.NameValueCollection</a>.
|
||||
</p>
|
||||
<h2>Syntax</h2>
|
||||
<div class="Signature">public static <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a> <b>GetCookies</b> (<i>this</i> <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Specialized.NameValueCollection">System.Collections.Specialized.NameValueCollection</a> headers, <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean">bool</a> response)</div>
|
||||
<h4 class="Subsection">Parameters</h4>
|
||||
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Ext.GetCookies(System.Collections.Specialized.NameValueCollection,System.Boolean):Parameters">
|
||||
<dl>
|
||||
<dt>
|
||||
<i>headers</i>
|
||||
</dt>
|
||||
<dd>
|
||||
A <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Specialized.NameValueCollection">System.Collections.Specialized.NameValueCollection</a> that contains a collection of the HTTP Headers.
|
||||
</dd>
|
||||
<dt>
|
||||
<i>response</i>
|
||||
</dt>
|
||||
<dd>
|
||||
<tt>true</tt> if gets from the response <i>headers</i>;
|
||||
from the request <i>headers</i>, <tt>false</tt>.
|
||||
</dd>
|
||||
</dl>
|
||||
</blockquote>
|
||||
<h4 class="Subsection">Returns</h4>
|
||||
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Ext.GetCookies(System.Collections.Specialized.NameValueCollection,System.Boolean):Returns">
|
||||
A <a href="../WebSocketSharp.Net/CookieCollection.html">WebSocketSharp.Net.CookieCollection</a> that receives a collection of the HTTP Cookies.
|
||||
</blockquote>
|
||||
<h2 class="Section">Remarks</h2>
|
||||
<div class="SectionBox" id="M:WebSocketSharp.Ext.GetCookies(System.Collections.Specialized.NameValueCollection,System.Boolean):Remarks">
|
||||
<span class="NotEntered">Documentation for this section has not yet been entered.</span>
|
||||
</div>
|
||||
<h2 class="Section">Requirements</h2>
|
||||
<div class="SectionBox" id="M:WebSocketSharp.Ext.GetCookies(System.Collections.Specialized.NameValueCollection,System.Boolean):Version Information">
|
||||
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
||||
<hr size="1" />
|
||||
</blockquote>
|
||||
<h3 id="M:WebSocketSharp.Ext.GetDescription(WebSocketSharp.Net.HttpStatusCode)">GetDescription Method</h3>
|
||||
<blockquote id="M:WebSocketSharp.Ext.GetDescription(WebSocketSharp.Net.HttpStatusCode):member">
|
||||
<p class="Summary">
|
||||
|
@@ -269,6 +269,20 @@
|
||||
<div class="SectionBox" id="Public Properties">
|
||||
<div class="SubsectionBox">
|
||||
<table class="TypeMembers">
|
||||
<tr valign="top">
|
||||
<td>[read-only]<div></div></td>
|
||||
<td>
|
||||
<b>
|
||||
<a href="#P:WebSocketSharp.WebSocket.Cookies">Cookies</a>
|
||||
</b>
|
||||
</td>
|
||||
<td>
|
||||
<i>
|
||||
<a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<WebSocketSharp.Net.Cookie></a>
|
||||
</i>.
|
||||
Gets the cookies used in the WebSocket opening handshake.
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>[read-only]<div></div></td>
|
||||
<td>
|
||||
@@ -542,6 +556,18 @@
|
||||
<a href="#M:WebSocketSharp.WebSocket.SendAsync(System.String,System.Action)">SendAsync</a>
|
||||
</b>(<a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a>, <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Action">Action</a>)<blockquote>
|
||||
Sends a text <i>data</i> asynchronously using the WebSocket connection.
|
||||
</blockquote></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<div>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<b>
|
||||
<a href="#M:WebSocketSharp.WebSocket.SetCookie(WebSocketSharp.Net.Cookie)">SetCookie</a>
|
||||
</b>(<a href="../WebSocketSharp.Net/Cookie.html">WebSocketSharp.Net.Cookie</a>)<blockquote>
|
||||
Sets a <a href="../WebSocketSharp.Net/Cookie.html">WebSocketSharp.Net.Cookie</a> used in the WebSocket opening handshake.
|
||||
</blockquote></td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -944,6 +970,27 @@
|
||||
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
||||
<hr size="1" />
|
||||
</blockquote>
|
||||
<h3 id="P:WebSocketSharp.WebSocket.Cookies">Cookies Property</h3>
|
||||
<blockquote id="P:WebSocketSharp.WebSocket.Cookies:member">
|
||||
<p class="Summary">
|
||||
Gets the cookies used in the WebSocket opening handshake.
|
||||
</p>
|
||||
<h2>Syntax</h2>
|
||||
<div class="Signature">public <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.IEnumerable`1">IEnumerable<WebSocketSharp.Net.Cookie></a> <b>Cookies</b> { get; }</div>
|
||||
<h4 class="Subsection">Value</h4>
|
||||
<blockquote class="SubsectionBox" id="P:WebSocketSharp.WebSocket.Cookies:Value">
|
||||
An IEnumerable<Cookie> interface that provides an enumerator which supports the iteration
|
||||
over the collection of cookies.
|
||||
</blockquote>
|
||||
<h2 class="Section">Remarks</h2>
|
||||
<div class="SectionBox" id="P:WebSocketSharp.WebSocket.Cookies:Remarks">
|
||||
<span class="NotEntered">Documentation for this section has not yet been entered.</span>
|
||||
</div>
|
||||
<h2 class="Section">Requirements</h2>
|
||||
<div class="SectionBox" id="P:WebSocketSharp.WebSocket.Cookies:Version Information">
|
||||
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
||||
<hr size="1" />
|
||||
</blockquote>
|
||||
<h3 id="M:WebSocketSharp.WebSocket.Dispose">Dispose Method</h3>
|
||||
<blockquote id="M:WebSocketSharp.WebSocket.Dispose:member">
|
||||
<p class="Summary">
|
||||
@@ -1358,6 +1405,33 @@
|
||||
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
||||
<hr size="1" />
|
||||
</blockquote>
|
||||
<h3 id="M:WebSocketSharp.WebSocket.SetCookie(WebSocketSharp.Net.Cookie)">SetCookie Method</h3>
|
||||
<blockquote id="M:WebSocketSharp.WebSocket.SetCookie(WebSocketSharp.Net.Cookie):member">
|
||||
<p class="Summary">
|
||||
Sets a <a href="../WebSocketSharp.Net/Cookie.html">WebSocketSharp.Net.Cookie</a> used in the WebSocket opening handshake.
|
||||
</p>
|
||||
<h2>Syntax</h2>
|
||||
<div class="Signature">public <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void">void</a> <b>SetCookie</b> (<a href="../WebSocketSharp.Net/Cookie.html">WebSocketSharp.Net.Cookie</a> cookie)</div>
|
||||
<h4 class="Subsection">Parameters</h4>
|
||||
<blockquote class="SubsectionBox" id="M:WebSocketSharp.WebSocket.SetCookie(WebSocketSharp.Net.Cookie):Parameters">
|
||||
<dl>
|
||||
<dt>
|
||||
<i>cookie</i>
|
||||
</dt>
|
||||
<dd>
|
||||
A <a href="../WebSocketSharp.Net/Cookie.html">WebSocketSharp.Net.Cookie</a> that contains an HTTP Cookie to set.
|
||||
</dd>
|
||||
</dl>
|
||||
</blockquote>
|
||||
<h2 class="Section">Remarks</h2>
|
||||
<div class="SectionBox" id="M:WebSocketSharp.WebSocket.SetCookie(WebSocketSharp.Net.Cookie):Remarks">
|
||||
<span class="NotEntered">Documentation for this section has not yet been entered.</span>
|
||||
</div>
|
||||
<h2 class="Section">Requirements</h2>
|
||||
<div class="SectionBox" id="M:WebSocketSharp.WebSocket.SetCookie(WebSocketSharp.Net.Cookie):Version Information">
|
||||
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
||||
<hr size="1" />
|
||||
</blockquote>
|
||||
<h3 id="P:WebSocketSharp.WebSocket.Url">Url Property</h3>
|
||||
<blockquote id="P:WebSocketSharp.WebSocket.Url:member">
|
||||
<p class="Summary">
|
||||
|
@@ -287,7 +287,7 @@
|
||||
Gets or sets a value indicating whether the cookie has expired.
|
||||
</summary>
|
||||
<value>
|
||||
<c>true</c> if the cookie has expired; otherwise, <c>false</c>.
|
||||
<c>true</c> if the cookie has expired; otherwise, <c>false</c>. The default is <c>false</c>.
|
||||
</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
@@ -305,6 +305,7 @@
|
||||
</summary>
|
||||
<value>
|
||||
A <see cref="T:System.DateTime" /> that contains the date and time at which the cookie expires.
|
||||
The default is <see cref="F:System.DateTime.MinValue" />.
|
||||
</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
@@ -406,7 +407,7 @@
|
||||
</value>
|
||||
<remarks>To be added.</remarks>
|
||||
<exception cref="T:WebSocketSharp.Net.CookieException">
|
||||
The value specified for a set operation could not be parsed or is not enclosed in double quotes.
|
||||
The value specified for a set operation is not enclosed in double quotes or could not be parsed.
|
||||
</exception>
|
||||
</Docs>
|
||||
</Member>
|
||||
@@ -502,7 +503,7 @@
|
||||
</value>
|
||||
<remarks>To be added.</remarks>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">
|
||||
The value specified for a set operation is less than zero.
|
||||
The value specified for a set operation is not allowed. The value must be 0 or 1.
|
||||
</exception>
|
||||
</Docs>
|
||||
</Member>
|
||||
|
@@ -90,7 +90,7 @@
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="array">
|
||||
An <see cref="T:System.Array" /> that is the destination of the elements copied from the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
An <see cref="T:System.Array" /> is the destination of the elements copied from the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
</param>
|
||||
<param name="index">
|
||||
An <see cref="T:System.Int32" /> that indicates the zero-based index in <paramref name="array" /> at which copying begins.
|
||||
@@ -106,6 +106,22 @@
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">
|
||||
<paramref name="index" /> is less than zero.
|
||||
</exception>
|
||||
<exception cref="T:System.ArgumentException">
|
||||
<para>
|
||||
<paramref name="array" /> is multidimensional.
|
||||
</para>
|
||||
<para>
|
||||
-or-
|
||||
</para>
|
||||
<para>
|
||||
The number of elements in the <see cref="T:WebSocketSharp.Net.CookieCollection" /> is greater than the available space
|
||||
from index to the end of the destination <paramref name="array" />.
|
||||
</para>
|
||||
</exception>
|
||||
<exception cref="T:System.InvalidCastException">
|
||||
The elements in the <see cref="T:WebSocketSharp.Net.CookieCollection" /> cannot be cast automatically
|
||||
to the type of the destination <paramref name="array" />.
|
||||
</exception>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="CopyTo">
|
||||
@@ -121,7 +137,7 @@
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="array">
|
||||
An array of <see cref="T:WebSocketSharp.Net.Cookie" /> that is the destination of the elements copied from the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
An array of <see cref="T:WebSocketSharp.Net.Cookie" /> is the destination of the elements copied from the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
</param>
|
||||
<param name="index">
|
||||
An <see cref="T:System.Int32" /> that indicates the zero-based index in <paramref name="array" /> at which copying begins.
|
||||
@@ -137,6 +153,10 @@
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">
|
||||
<paramref name="index" /> is less than zero.
|
||||
</exception>
|
||||
<exception cref="T:System.ArgumentException">
|
||||
The number of elements in the <see cref="T:WebSocketSharp.Net.CookieCollection" /> is greater than the available space
|
||||
from index to the end of the destination <paramref name="array" />.
|
||||
</exception>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Count">
|
||||
@@ -223,7 +243,7 @@
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="index">
|
||||
An <see cref="T:System.Int32" /> that is the zero-based index of the <see cref="T:WebSocketSharp.Net.Cookie" /> to find.
|
||||
An <see cref="T:System.Int32" /> is the zero-based index of the <see cref="T:WebSocketSharp.Net.Cookie" /> to find.
|
||||
</param>
|
||||
<summary>
|
||||
Gets the <see cref="T:WebSocketSharp.Net.Cookie" /> with the specified <paramref name="index" /> from the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
@@ -250,7 +270,7 @@
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="name">
|
||||
A <see cref="T:System.String" /> that is the name of the <see cref="T:WebSocketSharp.Net.Cookie" /> to find.
|
||||
A <see cref="T:System.String" /> is the name of the <see cref="T:WebSocketSharp.Net.Cookie" /> to find.
|
||||
</param>
|
||||
<summary>
|
||||
Gets the <see cref="T:WebSocketSharp.Net.Cookie" /> with the specified <paramref name="name" /> from the <see cref="T:WebSocketSharp.Net.CookieCollection" />.
|
||||
|
@@ -318,6 +318,33 @@
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="ProcessCookies">
|
||||
<MemberSignature Language="C#" Value="protected virtual bool ProcessCookies (WebSocketSharp.Net.CookieCollection request, WebSocketSharp.Net.CookieCollection response);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool ProcessCookies(class WebSocketSharp.Net.CookieCollection request, class WebSocketSharp.Net.CookieCollection response) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="request" Type="WebSocketSharp.Net.CookieCollection" />
|
||||
<Parameter Name="response" Type="WebSocketSharp.Net.CookieCollection" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="request">
|
||||
A <see cref="T:WebSocketSharp.Net.CookieCollection" /> that contains a collection of the HTTP Cookies received from the client.
|
||||
</param>
|
||||
<param name="response">
|
||||
A <see cref="T:WebSocketSharp.Net.CookieCollection" /> that contains a collection of the HTTP Cookies to send to the client.
|
||||
</param>
|
||||
<summary>
|
||||
Processes the cookies used in the WebSocket opening handshake.
|
||||
</summary>
|
||||
<returns>
|
||||
<c>true</c> if processing the cookies is successfully; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="QueryString">
|
||||
<MemberSignature Language="C#" Value="protected System.Collections.Specialized.NameValueCollection QueryString { get; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Specialized.NameValueCollection QueryString" />
|
||||
|
@@ -292,6 +292,34 @@
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetCookies">
|
||||
<MemberSignature Language="C#" Value="public static WebSocketSharp.Net.CookieCollection GetCookies (this System.Collections.Specialized.NameValueCollection headers, bool response);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class WebSocketSharp.Net.CookieCollection GetCookies(class System.Collections.Specialized.NameValueCollection headers, bool response) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>WebSocketSharp.Net.CookieCollection</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="headers" Type="System.Collections.Specialized.NameValueCollection" RefType="this" />
|
||||
<Parameter Name="response" Type="System.Boolean" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="headers">
|
||||
A <see cref="T:System.Collections.Specialized.NameValueCollection" /> that contains a collection of the HTTP Headers.
|
||||
</param>
|
||||
<param name="response">
|
||||
<c>true</c> if gets from the response <paramref name="headers" />;
|
||||
from the request <paramref name="headers" />, <c>false</c>.
|
||||
</param>
|
||||
<summary>
|
||||
Gets the collection of cookies from the specified <see cref="T:System.Collections.Specialized.NameValueCollection" />.
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:WebSocketSharp.Net.CookieCollection" /> that receives a collection of the HTTP Cookies.
|
||||
</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetDescription">
|
||||
<MemberSignature Language="C#" Value="public static string GetDescription (this WebSocketSharp.Net.HttpStatusCode code);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string GetDescription(valuetype WebSocketSharp.Net.HttpStatusCode code) cil managed" />
|
||||
|
@@ -235,6 +235,24 @@
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Cookies">
|
||||
<MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerable<WebSocketSharp.Net.Cookie> Cookies { get; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<class WebSocketSharp.Net.Cookie> Cookies" />
|
||||
<MemberType>Property</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Collections.Generic.IEnumerable<WebSocketSharp.Net.Cookie></ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>
|
||||
Gets the cookies used in the WebSocket opening handshake.
|
||||
</summary>
|
||||
<value>
|
||||
An IEnumerable<Cookie> interface that provides an enumerator which supports the iteration
|
||||
over the collection of cookies.
|
||||
</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Dispose">
|
||||
<MemberSignature Language="C#" Value="public void Dispose ();" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" />
|
||||
@@ -569,6 +587,26 @@
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetCookie">
|
||||
<MemberSignature Language="C#" Value="public void SetCookie (WebSocketSharp.Net.Cookie cookie);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetCookie(class WebSocketSharp.Net.Cookie cookie) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="cookie" Type="WebSocketSharp.Net.Cookie" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="cookie">
|
||||
A <see cref="T:WebSocketSharp.Net.Cookie" /> that contains an HTTP Cookie to set.
|
||||
</param>
|
||||
<summary>
|
||||
Sets a <see cref="T:WebSocketSharp.Net.Cookie" /> used in the WebSocket opening handshake.
|
||||
</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Url">
|
||||
<MemberSignature Language="C#" Value="public Uri Url { get; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance class System.Uri Url" />
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<Overview>
|
||||
<Assemblies>
|
||||
<Assembly Name="websocket-sharp" Version="1.0.2.27469">
|
||||
<Assembly Name="websocket-sharp" Version="1.0.2.29046">
|
||||
<AssemblyPublicKey>[00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 11 00 00 00 29 17 fb 89 fe c3 91 f7 2b cb 8b e2 61 d2 3f 05 93 6d 65 a8 9e 63 72 a6 f5 d5 2c f2 9d 20 fa 0b c0 70 6a f6 88 7e 8b 90 3f 39 f5 76 c8 48 e0 bb 7b b2 7b ed d3 10 a7 1a 0f 70 98 0f 7f f4 4b 53 09 d2 a5 ef 36 c3 56 b4 aa f0 91 72 63 25 07 89 e0 93 3e 3f 2e f2 b9 73 0e 12 15 5d 43 56 c3 f4 70 a5 89 fe f7 f6 ac 3e 77 c2 d8 d0 84 91 f4 0c d1 f3 8e dc c3 c3 b8 38 3d 0c bf 17 de 20 78 c1 ]</AssemblyPublicKey>
|
||||
<Attributes>
|
||||
<Attribute>
|
||||
@@ -374,6 +374,36 @@
|
||||
<Link Type="WebSocketSharp.Ext" Member="M:WebSocketSharp.Ext.GetAbsolutePath(System.Uri)" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:System.Collections.Specialized.NameValueCollection" />
|
||||
</Targets>
|
||||
<Member MemberName="GetCookies">
|
||||
<MemberSignature Language="C#" Value="public static WebSocketSharp.Net.CookieCollection GetCookies (this System.Collections.Specialized.NameValueCollection headers, bool response);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class WebSocketSharp.Net.CookieCollection GetCookies(class System.Collections.Specialized.NameValueCollection headers, bool response) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>WebSocketSharp.Net.CookieCollection</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="headers" Type="System.Collections.Specialized.NameValueCollection" RefType="this" />
|
||||
<Parameter Name="response" Type="System.Boolean" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="headers">
|
||||
A <see cref="T:System.Collections.Specialized.NameValueCollection" /> that contains a collection of the HTTP Headers.
|
||||
</param>
|
||||
<param name="response">
|
||||
<c>true</c> if gets from the response <paramref name="headers" />;
|
||||
from the request <paramref name="headers" />, <c>false</c>.
|
||||
</param>
|
||||
<summary>
|
||||
Gets the collection of cookies from the specified <see cref="T:System.Collections.Specialized.NameValueCollection" />.
|
||||
</summary>
|
||||
</Docs>
|
||||
<Link Type="WebSocketSharp.Ext" Member="M:WebSocketSharp.Ext.GetCookies(System.Collections.Specialized.NameValueCollection,System.Boolean)" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:WebSocketSharp.Net.HttpStatusCode" />
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user