[Modify] Add the static constructor

This commit is contained in:
sta 2015-10-11 14:44:59 +09:00
parent 2dca329d6a
commit 6fdef3c7f2

View File

@ -117,7 +117,7 @@ namespace WebSocketSharp
/// <summary> /// <summary>
/// Represents the empty array of <see cref="byte"/> used internally. /// Represents the empty array of <see cref="byte"/> used internally.
/// </summary> /// </summary>
internal static readonly byte[] EmptyBytes = new byte[0]; internal static readonly byte[] EmptyBytes;
/// <summary> /// <summary>
/// Represents the length used to determine whether the data should be fragmented in sending. /// Represents the length used to determine whether the data should be fragmented in sending.
@ -131,12 +131,23 @@ namespace WebSocketSharp
/// and <c>Int32.MaxValue - 14</c> inclusive. /// and <c>Int32.MaxValue - 14</c> inclusive.
/// </para> /// </para>
/// </remarks> /// </remarks>
internal static readonly int FragmentLength = 1016; internal static readonly int FragmentLength;
/// <summary> /// <summary>
/// Represents the random number generator used internally. /// Represents the random number generator used internally.
/// </summary> /// </summary>
internal static readonly RandomNumberGenerator RandomNumber = new RNGCryptoServiceProvider (); internal static readonly RandomNumberGenerator RandomNumber;
#endregion
#region Static Constructor
static WebSocket ()
{
EmptyBytes = new byte[0];
FragmentLength = 1016;
RandomNumber = new RNGCryptoServiceProvider ();
}
#endregion #endregion