Fix a few words
This commit is contained in:
parent
3ec3bf8fc9
commit
9a3c6632de
@ -1,10 +1,10 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* ByteOrder.cs
|
* ByteOrder.cs
|
||||||
*
|
*
|
||||||
* The MIT License
|
* 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
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* CloseStatusCode.cs
|
* CloseStatusCode.cs
|
||||||
*
|
*
|
||||||
@ -49,59 +49,59 @@ namespace WebSocketSharp {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1000. Indicates a normal closure.
|
/// Equivalent to close status 1000. Indicates a normal closure.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
NORMAL = 1000,
|
NORMAL = 1000,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1001. Indicates that an endpoint is "going away".
|
/// Equivalent to close status 1001. Indicates that an endpoint is "going away".
|
||||||
/// </summary>
|
/// </summary>
|
||||||
AWAY = 1001,
|
AWAY = 1001,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1002. Indicates that an endpoint is terminating the connection
|
/// Equivalent to close status 1002. Indicates that an endpoint is terminating the connection
|
||||||
/// due to a protocol error.
|
/// due to a protocol error.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PROTOCOL_ERROR = 1002,
|
PROTOCOL_ERROR = 1002,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1003. Indicates that an endpoint is terminating the connection
|
/// Equivalent to close status 1003. Indicates that an endpoint is terminating the connection
|
||||||
/// because it has received a type of data it cannot accept.
|
/// because it has received a type of data it cannot accept.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
INCORRECT_DATA = 1003,
|
INCORRECT_DATA = 1003,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1004. Still undefined. Reserved value.
|
/// Equivalent to close status 1004. Still undefined. Reserved value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
UNDEFINED = 1004,
|
UNDEFINED = 1004,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1005. Indicates that no status code was actually present. Reserved value.
|
/// Equivalent to close status 1005. Indicates that no status code was actually present. Reserved value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
NO_STATUS_CODE = 1005,
|
NO_STATUS_CODE = 1005,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1006. Indicates that the connection was closed abnormally. Reserved value.
|
/// Equivalent to close status 1006. Indicates that the connection was closed abnormally. Reserved value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ABNORMAL = 1006,
|
ABNORMAL = 1006,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1007. Indicates that an endpoint is terminating the connection
|
/// 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.
|
/// because it has received data within a message that was not consistent with the type of the message.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
INCONSISTENT_DATA = 1007,
|
INCONSISTENT_DATA = 1007,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1008. Indicates that an endpoint is terminating the connection
|
/// Equivalent to close status 1008. Indicates that an endpoint is terminating the connection
|
||||||
/// because it has received a message that violates its policy.
|
/// because it has received a message that violates its policy.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
POLICY_VIOLATION = 1008,
|
POLICY_VIOLATION = 1008,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1009. Indicates that an endpoint is terminating the connection
|
/// 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.
|
/// because it has received a message that is too big for it to process.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TOO_BIG = 1009,
|
TOO_BIG = 1009,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1010. Indicates that an endpoint (client) is terminating the connection
|
/// 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
|
/// 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.
|
/// them in the response message of the WebSocket handshake.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IGNORE_EXTENSION = 1010,
|
IGNORE_EXTENSION = 1010,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1011. Indicates that a server is terminating the connection because it encountered
|
/// 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.
|
/// an unexpected condition that prevented it from fulfilling the request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SERVER_ERROR = 1011,
|
SERVER_ERROR = 1011,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to close status 1015. Indicates that the connection was closed due to a failure to perform
|
/// Equivalent to close status 1015. Indicates that the connection was closed due to a failure to perform
|
||||||
/// a TLS handshake. Reserved value.
|
/// a TLS handshake. Reserved value.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* ErrorEventArgs.cs
|
* ErrorEventArgs.cs
|
||||||
*
|
*
|
||||||
* The MIT License
|
* 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
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -39,7 +39,7 @@ namespace WebSocketSharp {
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class ErrorEventArgs : EventArgs
|
public class ErrorEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
#region Constructor
|
#region Internal Constructors
|
||||||
|
|
||||||
internal ErrorEventArgs(string message)
|
internal ErrorEventArgs(string message)
|
||||||
{
|
{
|
||||||
@ -48,7 +48,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Property
|
#region Public Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the error message.
|
/// Gets the error message.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* Fin.cs
|
* Fin.cs
|
||||||
*
|
*
|
||||||
@ -32,7 +32,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
internal enum Fin : byte
|
internal enum Fin : byte
|
||||||
{
|
{
|
||||||
MORE = 0x0,
|
MORE = 0x0,
|
||||||
FINAL = 0x1
|
FINAL = 0x1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* Handshake.cs
|
* Handshake.cs
|
||||||
*
|
*
|
||||||
@ -35,13 +35,13 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
internal abstract class Handshake {
|
internal abstract class Handshake {
|
||||||
|
|
||||||
#region Field
|
#region Protected Const Fields
|
||||||
|
|
||||||
protected const string _crlf = "\r\n";
|
protected const string _crlf = "\r\n";
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor
|
#region Protected Constructors
|
||||||
|
|
||||||
protected Handshake()
|
protected Handshake()
|
||||||
{
|
{
|
||||||
@ -51,14 +51,14 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Public Properties
|
||||||
|
|
||||||
public NameValueCollection Headers { get; internal set; }
|
public NameValueCollection Headers { get; internal set; }
|
||||||
public Version ProtocolVersion { get; internal set; }
|
public Version ProtocolVersion { get; internal set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Methods
|
#region Public Methods
|
||||||
|
|
||||||
public void AddHeader(string name, string value)
|
public void AddHeader(string name, string value)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* Mask.cs
|
* Mask.cs
|
||||||
*
|
*
|
||||||
@ -33,6 +33,6 @@ namespace WebSocketSharp {
|
|||||||
internal enum Mask : byte
|
internal enum Mask : byte
|
||||||
{
|
{
|
||||||
UNMASK = 0x0,
|
UNMASK = 0x0,
|
||||||
MASK = 0x1
|
MASK = 0x1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* SslStream.cs
|
* SslStream.cs
|
||||||
*
|
*
|
||||||
* The MIT License
|
* 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
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* 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
|
internal class SslStream : System.Net.Security.SslStream
|
||||||
{
|
{
|
||||||
#region Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public SslStream(NetworkStream innerStream)
|
public SslStream(NetworkStream innerStream)
|
||||||
: base(innerStream)
|
: base(innerStream)
|
||||||
@ -70,7 +70,7 @@ namespace WebSocketSharp.Net.Security {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Property
|
#region Public Properties
|
||||||
|
|
||||||
public bool DataAvailable {
|
public bool DataAvailable {
|
||||||
get {
|
get {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* HttpListenerWebSocketContext.cs
|
* HttpListenerWebSocketContext.cs
|
||||||
*
|
*
|
||||||
@ -40,7 +40,7 @@ namespace WebSocketSharp.Net.WebSockets {
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class HttpListenerWebSocketContext : WebSocketContext
|
public class HttpListenerWebSocketContext : WebSocketContext
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Private Fields
|
||||||
|
|
||||||
private HttpListenerContext _context;
|
private HttpListenerContext _context;
|
||||||
private WebSocket _websocket;
|
private WebSocket _websocket;
|
||||||
@ -48,7 +48,7 @@ namespace WebSocketSharp.Net.WebSockets {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor
|
#region Internal Constructors
|
||||||
|
|
||||||
internal HttpListenerWebSocketContext(HttpListenerContext context)
|
internal HttpListenerWebSocketContext(HttpListenerContext context)
|
||||||
{
|
{
|
||||||
@ -59,7 +59,7 @@ namespace WebSocketSharp.Net.WebSockets {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Internal Property
|
#region Internal Properties
|
||||||
|
|
||||||
internal WsStream Stream {
|
internal WsStream Stream {
|
||||||
get {
|
get {
|
||||||
@ -290,7 +290,7 @@ namespace WebSocketSharp.Net.WebSockets {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Internal Method
|
#region Internal Methods
|
||||||
|
|
||||||
internal void Close()
|
internal void Close()
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* TcpListenerWebSocketContext.cs
|
* TcpListenerWebSocketContext.cs
|
||||||
*
|
*
|
||||||
@ -41,7 +41,7 @@ namespace WebSocketSharp.Net.WebSockets {
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class TcpListenerWebSocketContext : WebSocketContext
|
public class TcpListenerWebSocketContext : WebSocketContext
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Private Fields
|
||||||
|
|
||||||
private CookieCollection _cookies;
|
private CookieCollection _cookies;
|
||||||
private TcpClient _tcpClient;
|
private TcpClient _tcpClient;
|
||||||
@ -52,7 +52,7 @@ namespace WebSocketSharp.Net.WebSockets {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor
|
#region Internal Constructors
|
||||||
|
|
||||||
internal TcpListenerWebSocketContext(TcpClient tcpClient, bool secure)
|
internal TcpListenerWebSocketContext(TcpClient tcpClient, bool secure)
|
||||||
{
|
{
|
||||||
@ -305,7 +305,7 @@ namespace WebSocketSharp.Net.WebSockets {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Internal Method
|
#region Internal Methods
|
||||||
|
|
||||||
internal void Close()
|
internal void Close()
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* WebSocketContext.cs
|
* WebSocketContext.cs
|
||||||
*
|
*
|
||||||
@ -41,7 +41,7 @@ namespace WebSocketSharp.Net.WebSockets {
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public abstract class WebSocketContext {
|
public abstract class WebSocketContext {
|
||||||
|
|
||||||
#region Constructor
|
#region Protected Constructors
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="WebSocketSharp.Net.WebSockets.WebSocketContext"/> class.
|
/// Initializes a new instance of the <see cref="WebSocketSharp.Net.WebSockets.WebSocketContext"/> class.
|
||||||
@ -52,7 +52,7 @@ namespace WebSocketSharp.Net.WebSockets {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Public Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the cookies used in the WebSocket opening handshake.
|
/// Gets the cookies used in the WebSocket opening handshake.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* Rsv.cs
|
* Rsv.cs
|
||||||
*
|
*
|
||||||
@ -33,6 +33,6 @@ namespace WebSocketSharp {
|
|||||||
internal enum Rsv : byte
|
internal enum Rsv : byte
|
||||||
{
|
{
|
||||||
OFF = 0x0,
|
OFF = 0x0,
|
||||||
ON = 0x1
|
ON = 0x1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* HttpRequestEventArgs.cs
|
* HttpRequestEventArgs.cs
|
||||||
*
|
*
|
||||||
@ -41,17 +41,17 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class HttpRequestEventArgs : EventArgs
|
public class HttpRequestEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
#region Constructor
|
#region Internal Constructors
|
||||||
|
|
||||||
internal HttpRequestEventArgs(HttpListenerContext context)
|
internal HttpRequestEventArgs(HttpListenerContext context)
|
||||||
{
|
{
|
||||||
Request = context.Request;
|
Request = context.Request;
|
||||||
Response = context.Response;
|
Response = context.Response;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Public Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the HTTP request objects sent from a client.
|
/// Gets the HTTP request objects sent from a client.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* HttpServer.cs
|
* HttpServer.cs
|
||||||
*
|
*
|
||||||
@ -59,7 +59,7 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class HttpServer {
|
public class HttpServer {
|
||||||
|
|
||||||
#region Fields
|
#region Private Fields
|
||||||
|
|
||||||
private bool _isWindows;
|
private bool _isWindows;
|
||||||
private HttpListener _listener;
|
private HttpListener _listener;
|
||||||
@ -70,7 +70,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="HttpServer"/> class that listens for incoming requests
|
/// Initializes a new instance of the <see cref="HttpServer"/> class that listens for incoming requests
|
||||||
@ -96,7 +96,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Public Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the port on which to listen for incoming requests.
|
/// Gets the port on which to listen for incoming requests.
|
||||||
@ -139,7 +139,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Events
|
#region Public Events
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when the server receives an HTTP CONNECT request.
|
/// Occurs when the server receives an HTTP CONNECT request.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* IServiceHost.cs
|
* IServiceHost.cs
|
||||||
*
|
*
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* ServiceHostManager.cs
|
* ServiceHostManager.cs
|
||||||
*
|
*
|
||||||
@ -33,14 +33,14 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
internal class ServiceHostManager {
|
internal class ServiceHostManager {
|
||||||
|
|
||||||
#region Fields
|
#region Private Fields
|
||||||
|
|
||||||
private Dictionary<string, IServiceHost> _svcHosts;
|
private Dictionary<string, IServiceHost> _svcHosts;
|
||||||
private bool _sweeped;
|
private bool _sweeped;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor
|
#region Public Constructors
|
||||||
|
|
||||||
public ServiceHostManager()
|
public ServiceHostManager()
|
||||||
{
|
{
|
||||||
@ -50,7 +50,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Public Properties
|
||||||
|
|
||||||
public int Count {
|
public int Count {
|
||||||
get {
|
get {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* WebSocketServer.cs
|
* WebSocketServer.cs
|
||||||
*
|
*
|
||||||
@ -44,7 +44,7 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class WebSocketServer : WebSocketServerBase
|
public class WebSocketServer : WebSocketServerBase
|
||||||
{
|
{
|
||||||
#region Field
|
#region Private Fields
|
||||||
|
|
||||||
private ServiceHostManager _svcHosts;
|
private ServiceHostManager _svcHosts;
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Public Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the collection of paths associated with the every WebSocket services that the server provides.
|
/// Gets the collection of paths associated with the every WebSocket services that the server provides.
|
||||||
@ -179,7 +179,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Method
|
#region Private Methods
|
||||||
|
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
@ -188,7 +188,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Protected Method
|
#region Protected Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Accepts a WebSocket connection request.
|
/// Accepts a WebSocket connection request.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* WebSocketServerBase.cs
|
* WebSocketServerBase.cs
|
||||||
*
|
*
|
||||||
@ -43,7 +43,7 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public abstract class WebSocketServerBase {
|
public abstract class WebSocketServerBase {
|
||||||
|
|
||||||
#region Fields
|
#region Private Fields
|
||||||
|
|
||||||
private Thread _receiveRequestThread;
|
private Thread _receiveRequestThread;
|
||||||
private IPAddress _address;
|
private IPAddress _address;
|
||||||
@ -55,7 +55,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Protected Constructors
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="WebSocketServerBase"/> class.
|
/// Initializes a new instance of the <see cref="WebSocketServerBase"/> class.
|
||||||
@ -153,7 +153,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Protected Property
|
#region Protected Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the WebSocket URL on which to listen for incoming connection attempts.
|
/// Gets or sets the WebSocket URL on which to listen for incoming connection attempts.
|
||||||
@ -226,7 +226,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Event
|
#region Public Events
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when the server gets an error.
|
/// Occurs when the server gets an error.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* WebSocketService.cs
|
* WebSocketService.cs
|
||||||
*
|
*
|
||||||
@ -51,7 +51,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Public Constructor
|
#region Public Constructors
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="WebSocketService"/> class.
|
/// Initializes a new instance of the <see cref="WebSocketService"/> class.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* WebSocketServiceHost.cs
|
* WebSocketServiceHost.cs
|
||||||
*
|
*
|
||||||
@ -48,13 +48,13 @@ namespace WebSocketSharp.Server {
|
|||||||
public class WebSocketServiceHost<T> : WebSocketServerBase, IServiceHost
|
public class WebSocketServiceHost<T> : WebSocketServerBase, IServiceHost
|
||||||
where T : WebSocketService, new()
|
where T : WebSocketService, new()
|
||||||
{
|
{
|
||||||
#region Field
|
#region Private Fields
|
||||||
|
|
||||||
private WebSocketServiceManager _sessions;
|
private WebSocketServiceManager _sessions;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Internal Constructor
|
#region Internal Constructors
|
||||||
|
|
||||||
internal WebSocketServiceHost()
|
internal WebSocketServiceHost()
|
||||||
{
|
{
|
||||||
@ -180,7 +180,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Public Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether the server cleans up the inactive clients periodically.
|
/// Gets or sets a value indicating whether the server cleans up the inactive clients periodically.
|
||||||
@ -217,7 +217,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Method
|
#region Private Methods
|
||||||
|
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
@ -226,24 +226,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Explicit Interface Implementation
|
#region Protected Methods
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Binds the specified <see cref="WebSocketContext"/> to a <see cref="WebSocketService"/> instance.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">
|
|
||||||
/// A <see cref="WebSocketContext"/> that contains the WebSocket connection request objects to bind.
|
|
||||||
/// </param>
|
|
||||||
void IServiceHost.BindWebSocket(WebSocketContext context)
|
|
||||||
{
|
|
||||||
T service = new T();
|
|
||||||
service.Bind(context, _sessions);
|
|
||||||
service.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Protected Method
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Accepts a WebSocket connection request.
|
/// Accepts a WebSocket connection request.
|
||||||
@ -307,5 +290,22 @@ namespace WebSocketSharp.Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Explicit Interface Implementation
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Binds the specified <see cref="WebSocketContext"/> to a <see cref="WebSocketService"/> instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context">
|
||||||
|
/// A <see cref="WebSocketContext"/> that contains the WebSocket connection request objects to bind.
|
||||||
|
/// </param>
|
||||||
|
void IServiceHost.BindWebSocket(WebSocketContext context)
|
||||||
|
{
|
||||||
|
T service = new T();
|
||||||
|
service.Bind(context, _sessions);
|
||||||
|
service.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* WebSocketServiceManager.cs
|
* WebSocketServiceManager.cs
|
||||||
*
|
*
|
||||||
@ -38,7 +38,7 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class WebSocketServiceManager {
|
public class WebSocketServiceManager {
|
||||||
|
|
||||||
#region Fields
|
#region Private Fields
|
||||||
|
|
||||||
private object _forSweep;
|
private object _forSweep;
|
||||||
private volatile bool _isStopped;
|
private volatile bool _isStopped;
|
||||||
@ -49,7 +49,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor
|
#region Internal Constructors
|
||||||
|
|
||||||
internal WebSocketServiceManager()
|
internal WebSocketServiceManager()
|
||||||
{
|
{
|
||||||
@ -65,7 +65,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Public Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the collection of IDs of active <see cref="WebSocketService"/> objects
|
/// Gets the collection of IDs of active <see cref="WebSocketService"/> objects
|
||||||
|
@ -383,7 +383,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Events
|
#region Public Events
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when the <see cref="WebSocket"/> receives a Close frame or the Close method is called.
|
/// Occurs when the <see cref="WebSocket"/> receives a Close frame or the Close method is called.
|
||||||
@ -1384,9 +1384,9 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Internal Method
|
#region Internal Methods
|
||||||
|
|
||||||
// As Server
|
// As server
|
||||||
internal void Close(HttpStatusCode code)
|
internal void Close(HttpStatusCode code)
|
||||||
{
|
{
|
||||||
close(code);
|
close(code);
|
||||||
|
@ -64,7 +64,7 @@ namespace WebSocketSharp {
|
|||||||
/// One of the <see cref="CloseStatusCode"/> values that indicates the cause of the exception.
|
/// One of the <see cref="CloseStatusCode"/> values that indicates the cause of the exception.
|
||||||
/// </value>
|
/// </value>
|
||||||
public CloseStatusCode Code {
|
public CloseStatusCode Code {
|
||||||
get; internal set;
|
get; private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* WsState.cs
|
* WsState.cs
|
||||||
*
|
*
|
||||||
* The MIT License
|
* 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
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -46,14 +46,14 @@ namespace WebSocketSharp {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to numeric value 1. Indicates that the connection is established and communication is possible.
|
/// Equivalent to numeric value 1. Indicates that the connection is established and communication is possible.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
OPEN = 1,
|
OPEN = 1,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to numeric value 2. Indicates that the connection is going through the closing handshake, or the <b>Close</b> method has been invoked.
|
/// Equivalent to numeric value 2. Indicates that the connection is going through the closing handshake, or the <b>Close</b> method has been invoked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
CLOSING = 2,
|
CLOSING = 2,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Equivalent to numeric value 3. Indicates that the connection has been closed or could not be opened.
|
/// Equivalent to numeric value 3. Indicates that the connection has been closed or could not be opened.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
CLOSED = 3
|
CLOSED = 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user