[Modify] Add it

This commit is contained in:
sta 2016-03-10 15:33:34 +09:00
parent fcc783497d
commit 18597a35c1

View File

@ -14,7 +14,7 @@
* Copyright (c) 2003 Ben Maurer
* Copyright (c) 2003, 2005, 2009 Novell, Inc. (http://www.novell.com)
* Copyright (c) 2009 Stephane Delcroix
* Copyright (c) 2010-2015 sta.blockhead
* Copyright (c) 2010-2016 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
@ -214,6 +214,18 @@ namespace WebSocketSharp
return time <= TimeSpan.Zero ? "A wait time is zero or less." : null;
}
internal static bool CheckWaitTime (this TimeSpan time, out string message)
{
message = null;
if (time <= TimeSpan.Zero) {
message = "A wait time is zero or less.";
return false;
}
return true;
}
internal static void Close (this HttpListenerResponse response, HttpStatusCode code)
{
response.StatusCode = (int) code;