diff --git a/websocket-sharp/ByteOrder.cs b/websocket-sharp/ByteOrder.cs index df8013ea..6a60287c 100644 --- a/websocket-sharp/ByteOrder.cs +++ b/websocket-sharp/ByteOrder.cs @@ -1,10 +1,10 @@ -#region MIT License +#region License /* * ByteOrder.cs * * 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 diff --git a/websocket-sharp/CloseStatusCode.cs b/websocket-sharp/CloseStatusCode.cs index 59c79a54..0c2146e0 100644 --- a/websocket-sharp/CloseStatusCode.cs +++ b/websocket-sharp/CloseStatusCode.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * CloseStatusCode.cs * @@ -49,59 +49,59 @@ namespace WebSocketSharp { /// /// Equivalent to close status 1000. Indicates a normal closure. /// - NORMAL = 1000, + NORMAL = 1000, /// /// Equivalent to close status 1001. Indicates that an endpoint is "going away". /// - AWAY = 1001, + AWAY = 1001, /// /// Equivalent to close status 1002. Indicates that an endpoint is terminating the connection /// due to a protocol error. /// - PROTOCOL_ERROR = 1002, + PROTOCOL_ERROR = 1002, /// /// Equivalent to close status 1003. Indicates that an endpoint is terminating the connection /// because it has received a type of data it cannot accept. /// - INCORRECT_DATA = 1003, + INCORRECT_DATA = 1003, /// /// Equivalent to close status 1004. Still undefined. Reserved value. /// - UNDEFINED = 1004, + UNDEFINED = 1004, /// /// Equivalent to close status 1005. Indicates that no status code was actually present. Reserved value. /// - NO_STATUS_CODE = 1005, + NO_STATUS_CODE = 1005, /// /// Equivalent to close status 1006. Indicates that the connection was closed abnormally. Reserved value. /// - ABNORMAL = 1006, + ABNORMAL = 1006, /// /// Equivalent to close status 1007. Indicates that an endpoint is terminating the connection /// because it has received data within a message that was not consistent with the type of the message. /// - INCONSISTENT_DATA = 1007, + INCONSISTENT_DATA = 1007, /// /// Equivalent to close status 1008. Indicates that an endpoint is terminating the connection /// because it has received a message that violates its policy. /// - POLICY_VIOLATION = 1008, + POLICY_VIOLATION = 1008, /// /// Equivalent to close status 1009. Indicates that an endpoint is terminating the connection /// because it has received a message that is too big for it to process. /// - TOO_BIG = 1009, + TOO_BIG = 1009, /// /// Equivalent to close status 1010. Indicates that an endpoint (client) is terminating the connection /// because it has expected the server to negotiate one or more extension, but the server didn't return /// them in the response message of the WebSocket handshake. /// - IGNORE_EXTENSION = 1010, + IGNORE_EXTENSION = 1010, /// /// Equivalent to close status 1011. Indicates that a server is terminating the connection because it encountered /// an unexpected condition that prevented it from fulfilling the request. /// - SERVER_ERROR = 1011, + SERVER_ERROR = 1011, /// /// Equivalent to close status 1015. Indicates that the connection was closed due to a failure to perform /// a TLS handshake. Reserved value. diff --git a/websocket-sharp/ErrorEventArgs.cs b/websocket-sharp/ErrorEventArgs.cs index 329af9ef..9b11c626 100644 --- a/websocket-sharp/ErrorEventArgs.cs +++ b/websocket-sharp/ErrorEventArgs.cs @@ -1,10 +1,10 @@ -#region MIT License +#region License /* * ErrorEventArgs.cs * * 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 @@ -39,7 +39,7 @@ namespace WebSocketSharp { /// public class ErrorEventArgs : EventArgs { - #region Constructor + #region Internal Constructors internal ErrorEventArgs(string message) { @@ -48,7 +48,7 @@ namespace WebSocketSharp { #endregion - #region Property + #region Public Properties /// /// Gets the error message. diff --git a/websocket-sharp/Fin.cs b/websocket-sharp/Fin.cs index 96521bad..9698abad 100644 --- a/websocket-sharp/Fin.cs +++ b/websocket-sharp/Fin.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * Fin.cs * @@ -32,7 +32,7 @@ namespace WebSocketSharp { internal enum Fin : byte { - MORE = 0x0, + MORE = 0x0, FINAL = 0x1 } } diff --git a/websocket-sharp/Handshake.cs b/websocket-sharp/Handshake.cs index aad14a4d..a0ccef63 100644 --- a/websocket-sharp/Handshake.cs +++ b/websocket-sharp/Handshake.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * Handshake.cs * @@ -35,13 +35,13 @@ namespace WebSocketSharp { internal abstract class Handshake { - #region Field + #region Protected Const Fields protected const string _crlf = "\r\n"; #endregion - #region Constructor + #region Protected Constructors protected Handshake() { @@ -51,14 +51,14 @@ namespace WebSocketSharp { #endregion - #region Properties + #region Public Properties public NameValueCollection Headers { get; internal set; } public Version ProtocolVersion { get; internal set; } #endregion - #region Methods + #region Public Methods public void AddHeader(string name, string value) { diff --git a/websocket-sharp/Mask.cs b/websocket-sharp/Mask.cs index eeb130af..051b46bf 100644 --- a/websocket-sharp/Mask.cs +++ b/websocket-sharp/Mask.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * Mask.cs * @@ -33,6 +33,6 @@ namespace WebSocketSharp { internal enum Mask : byte { UNMASK = 0x0, - MASK = 0x1 + MASK = 0x1 } } diff --git a/websocket-sharp/Net/Security/SslStream.cs b/websocket-sharp/Net/Security/SslStream.cs index 86a387ab..712464a4 100644 --- a/websocket-sharp/Net/Security/SslStream.cs +++ b/websocket-sharp/Net/Security/SslStream.cs @@ -1,10 +1,10 @@ -#region MIT License +#region License /* * SslStream.cs * * 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 @@ -34,7 +34,7 @@ namespace WebSocketSharp.Net.Security { internal class SslStream : System.Net.Security.SslStream { - #region Constructors + #region Public Constructors public SslStream(NetworkStream innerStream) : base(innerStream) @@ -70,7 +70,7 @@ namespace WebSocketSharp.Net.Security { #endregion - #region Property + #region Public Properties public bool DataAvailable { get { diff --git a/websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs b/websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs index 908a3438..090541e6 100644 --- a/websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs +++ b/websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * HttpListenerWebSocketContext.cs * @@ -40,7 +40,7 @@ namespace WebSocketSharp.Net.WebSockets { /// public class HttpListenerWebSocketContext : WebSocketContext { - #region Fields + #region Private Fields private HttpListenerContext _context; private WebSocket _websocket; @@ -48,7 +48,7 @@ namespace WebSocketSharp.Net.WebSockets { #endregion - #region Constructor + #region Internal Constructors internal HttpListenerWebSocketContext(HttpListenerContext context) { @@ -59,7 +59,7 @@ namespace WebSocketSharp.Net.WebSockets { #endregion - #region Internal Property + #region Internal Properties internal WsStream Stream { get { @@ -290,7 +290,7 @@ namespace WebSocketSharp.Net.WebSockets { #endregion - #region Internal Method + #region Internal Methods internal void Close() { diff --git a/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs b/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs index cc25c578..32cecfb8 100644 --- a/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs +++ b/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * TcpListenerWebSocketContext.cs * @@ -41,7 +41,7 @@ namespace WebSocketSharp.Net.WebSockets { /// public class TcpListenerWebSocketContext : WebSocketContext { - #region Fields + #region Private Fields private CookieCollection _cookies; private TcpClient _tcpClient; @@ -52,7 +52,7 @@ namespace WebSocketSharp.Net.WebSockets { #endregion - #region Constructor + #region Internal Constructors internal TcpListenerWebSocketContext(TcpClient tcpClient, bool secure) { @@ -305,7 +305,7 @@ namespace WebSocketSharp.Net.WebSockets { #endregion - #region Internal Method + #region Internal Methods internal void Close() { diff --git a/websocket-sharp/Net/WebSockets/WebSocketContext.cs b/websocket-sharp/Net/WebSockets/WebSocketContext.cs index da29e6a5..a5bfad19 100644 --- a/websocket-sharp/Net/WebSockets/WebSocketContext.cs +++ b/websocket-sharp/Net/WebSockets/WebSocketContext.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * WebSocketContext.cs * @@ -41,7 +41,7 @@ namespace WebSocketSharp.Net.WebSockets { /// public abstract class WebSocketContext { - #region Constructor + #region Protected Constructors /// /// Initializes a new instance of the class. @@ -52,7 +52,7 @@ namespace WebSocketSharp.Net.WebSockets { #endregion - #region Properties + #region Public Properties /// /// Gets the cookies used in the WebSocket opening handshake. diff --git a/websocket-sharp/Rsv.cs b/websocket-sharp/Rsv.cs index 8b240a18..71ddf982 100644 --- a/websocket-sharp/Rsv.cs +++ b/websocket-sharp/Rsv.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * Rsv.cs * @@ -33,6 +33,6 @@ namespace WebSocketSharp { internal enum Rsv : byte { OFF = 0x0, - ON = 0x1 + ON = 0x1 } } diff --git a/websocket-sharp/Server/HttpRequestEventArgs.cs b/websocket-sharp/Server/HttpRequestEventArgs.cs index 8a0a4a3b..a06ceea3 100644 --- a/websocket-sharp/Server/HttpRequestEventArgs.cs +++ b/websocket-sharp/Server/HttpRequestEventArgs.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * HttpRequestEventArgs.cs * @@ -41,17 +41,17 @@ namespace WebSocketSharp.Server { /// public class HttpRequestEventArgs : EventArgs { - #region Constructor + #region Internal Constructors internal HttpRequestEventArgs(HttpListenerContext context) { - Request = context.Request; + Request = context.Request; Response = context.Response; } #endregion - #region Properties + #region Public Properties /// /// Gets the HTTP request objects sent from a client. diff --git a/websocket-sharp/Server/HttpServer.cs b/websocket-sharp/Server/HttpServer.cs index e090045c..2dd9dc2d 100644 --- a/websocket-sharp/Server/HttpServer.cs +++ b/websocket-sharp/Server/HttpServer.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * HttpServer.cs * @@ -59,7 +59,7 @@ namespace WebSocketSharp.Server { /// public class HttpServer { - #region Fields + #region Private Fields private bool _isWindows; private HttpListener _listener; @@ -70,7 +70,7 @@ namespace WebSocketSharp.Server { #endregion - #region Constructors + #region Public Constructors /// /// Initializes a new instance of the class that listens for incoming requests @@ -96,7 +96,7 @@ namespace WebSocketSharp.Server { #endregion - #region Properties + #region Public Properties /// /// Gets the port on which to listen for incoming requests. @@ -139,7 +139,7 @@ namespace WebSocketSharp.Server { #endregion - #region Events + #region Public Events /// /// Occurs when the server receives an HTTP CONNECT request. diff --git a/websocket-sharp/Server/IServiceHost.cs b/websocket-sharp/Server/IServiceHost.cs index 11644f7b..06ffcd07 100644 --- a/websocket-sharp/Server/IServiceHost.cs +++ b/websocket-sharp/Server/IServiceHost.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * IServiceHost.cs * diff --git a/websocket-sharp/Server/ServiceHostManager.cs b/websocket-sharp/Server/ServiceHostManager.cs index 9aa7fe66..9ff0930b 100644 --- a/websocket-sharp/Server/ServiceHostManager.cs +++ b/websocket-sharp/Server/ServiceHostManager.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * ServiceHostManager.cs * @@ -33,14 +33,14 @@ namespace WebSocketSharp.Server { internal class ServiceHostManager { - #region Fields + #region Private Fields private Dictionary _svcHosts; private bool _sweeped; #endregion - #region Constructor + #region Public Constructors public ServiceHostManager() { @@ -50,7 +50,7 @@ namespace WebSocketSharp.Server { #endregion - #region Properties + #region Public Properties public int Count { get { diff --git a/websocket-sharp/Server/WebSocketServer.cs b/websocket-sharp/Server/WebSocketServer.cs index 05d4797a..2af7ac21 100644 --- a/websocket-sharp/Server/WebSocketServer.cs +++ b/websocket-sharp/Server/WebSocketServer.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * WebSocketServer.cs * @@ -44,7 +44,7 @@ namespace WebSocketSharp.Server { /// public class WebSocketServer : WebSocketServerBase { - #region Field + #region Private Fields private ServiceHostManager _svcHosts; @@ -142,7 +142,7 @@ namespace WebSocketSharp.Server { #endregion - #region Properties + #region Public Properties /// /// Gets the collection of paths associated with the every WebSocket services that the server provides. @@ -179,7 +179,7 @@ namespace WebSocketSharp.Server { #endregion - #region Private Method + #region Private Methods private void init() { @@ -188,7 +188,7 @@ namespace WebSocketSharp.Server { #endregion - #region Protected Method + #region Protected Methods /// /// Accepts a WebSocket connection request. diff --git a/websocket-sharp/Server/WebSocketServerBase.cs b/websocket-sharp/Server/WebSocketServerBase.cs index b61a1b2a..0b930cf3 100644 --- a/websocket-sharp/Server/WebSocketServerBase.cs +++ b/websocket-sharp/Server/WebSocketServerBase.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * WebSocketServerBase.cs * @@ -43,7 +43,7 @@ namespace WebSocketSharp.Server { /// public abstract class WebSocketServerBase { - #region Fields + #region Private Fields private Thread _receiveRequestThread; private IPAddress _address; @@ -55,7 +55,7 @@ namespace WebSocketSharp.Server { #endregion - #region Constructors + #region Protected Constructors /// /// Initializes a new instance of the class. @@ -153,7 +153,7 @@ namespace WebSocketSharp.Server { #endregion - #region Protected Property + #region Protected Properties /// /// Gets or sets the WebSocket URL on which to listen for incoming connection attempts. @@ -226,7 +226,7 @@ namespace WebSocketSharp.Server { #endregion - #region Event + #region Public Events /// /// Occurs when the server gets an error. diff --git a/websocket-sharp/Server/WebSocketService.cs b/websocket-sharp/Server/WebSocketService.cs index 89f538c9..7d626343 100644 --- a/websocket-sharp/Server/WebSocketService.cs +++ b/websocket-sharp/Server/WebSocketService.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * WebSocketService.cs * @@ -51,7 +51,7 @@ namespace WebSocketSharp.Server { #endregion - #region Public Constructor + #region Public Constructors /// /// Initializes a new instance of the class. diff --git a/websocket-sharp/Server/WebSocketServiceHost.cs b/websocket-sharp/Server/WebSocketServiceHost.cs index bfe51d98..5abdede6 100644 --- a/websocket-sharp/Server/WebSocketServiceHost.cs +++ b/websocket-sharp/Server/WebSocketServiceHost.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * WebSocketServiceHost.cs * @@ -48,13 +48,13 @@ namespace WebSocketSharp.Server { public class WebSocketServiceHost : WebSocketServerBase, IServiceHost where T : WebSocketService, new() { - #region Field + #region Private Fields private WebSocketServiceManager _sessions; #endregion - #region Internal Constructor + #region Internal Constructors internal WebSocketServiceHost() { @@ -180,7 +180,7 @@ namespace WebSocketSharp.Server { #endregion - #region Properties + #region Public Properties /// /// Gets or sets a value indicating whether the server cleans up the inactive clients periodically. @@ -217,7 +217,7 @@ namespace WebSocketSharp.Server { #endregion - #region Private Method + #region Private Methods private void init() { @@ -226,24 +226,7 @@ namespace WebSocketSharp.Server { #endregion - #region Explicit Interface Implementation - - /// - /// Binds the specified to a instance. - /// - /// - /// A that contains the WebSocket connection request objects to bind. - /// - void IServiceHost.BindWebSocket(WebSocketContext context) - { - T service = new T(); - service.Bind(context, _sessions); - service.Start(); - } - - #endregion - - #region Protected Method + #region Protected Methods /// /// Accepts a WebSocket connection request. @@ -307,5 +290,22 @@ namespace WebSocketSharp.Server { } #endregion + + #region Explicit Interface Implementation + + /// + /// Binds the specified to a instance. + /// + /// + /// A that contains the WebSocket connection request objects to bind. + /// + void IServiceHost.BindWebSocket(WebSocketContext context) + { + T service = new T(); + service.Bind(context, _sessions); + service.Start(); + } + + #endregion } } diff --git a/websocket-sharp/Server/WebSocketServiceManager.cs b/websocket-sharp/Server/WebSocketServiceManager.cs index 9ce56f6d..515baf6a 100644 --- a/websocket-sharp/Server/WebSocketServiceManager.cs +++ b/websocket-sharp/Server/WebSocketServiceManager.cs @@ -1,4 +1,4 @@ -#region MIT License +#region License /* * WebSocketServiceManager.cs * @@ -38,7 +38,7 @@ namespace WebSocketSharp.Server { /// public class WebSocketServiceManager { - #region Fields + #region Private Fields private object _forSweep; private volatile bool _isStopped; @@ -49,7 +49,7 @@ namespace WebSocketSharp.Server { #endregion - #region Constructor + #region Internal Constructors internal WebSocketServiceManager() { @@ -65,7 +65,7 @@ namespace WebSocketSharp.Server { #endregion - #region Properties + #region Public Properties /// /// Gets the collection of IDs of active objects diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 2a70152f..626abb49 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -383,7 +383,7 @@ namespace WebSocketSharp { #endregion - #region Events + #region Public Events /// /// Occurs when the receives a Close frame or the Close method is called. @@ -1384,9 +1384,9 @@ namespace WebSocketSharp { #endregion - #region Internal Method + #region Internal Methods - // As Server + // As server internal void Close(HttpStatusCode code) { close(code); diff --git a/websocket-sharp/WebSocketException.cs b/websocket-sharp/WebSocketException.cs index 14ad02b7..2f26529d 100644 --- a/websocket-sharp/WebSocketException.cs +++ b/websocket-sharp/WebSocketException.cs @@ -64,7 +64,7 @@ namespace WebSocketSharp { /// One of the values that indicates the cause of the exception. /// public CloseStatusCode Code { - get; internal set; + get; private set; } #endregion diff --git a/websocket-sharp/WsState.cs b/websocket-sharp/WsState.cs index 422da31b..57fabf69 100644 --- a/websocket-sharp/WsState.cs +++ b/websocket-sharp/WsState.cs @@ -1,10 +1,10 @@ -#region MIT License +#region License /* * WsState.cs * * The MIT License * - * Copyright (c) 2010-2012 sta.blockhead + * Copyright (c) 2010-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 @@ -46,14 +46,14 @@ namespace WebSocketSharp { /// /// Equivalent to numeric value 1. Indicates that the connection is established and communication is possible. /// - OPEN = 1, + OPEN = 1, /// /// Equivalent to numeric value 2. Indicates that the connection is going through the closing handshake, or the Close method has been invoked. /// - CLOSING = 2, + CLOSING = 2, /// /// Equivalent to numeric value 3. Indicates that the connection has been closed or could not be opened. /// - CLOSED = 3 + CLOSED = 3 } } diff --git a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll index 4b8ecf2c..dc04ea62 100755 Binary files a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll and b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll differ