Skip to content

Instantly share code, notes, and snippets.

@rushfrisby
rushfrisby / KeyLockerExample.cs
Created June 30, 2015 15:41
Using KeyLocker
class KeyLockerExample
{
static readonly ThreadState[] StopStates = { ThreadState.AbortRequested, ThreadState.Aborted };
static void Main()
{
var threads = new List<Thread>();
var sw = new Stopwatch();
var timelimit = new TimeSpan(0, 0, 30);
@rushfrisby
rushfrisby / ServiceHelper.cs
Created April 5, 2017 19:46
WCF Service Helper
using System;
using System.ServiceModel;
public class ServiceHelper
{
#region Public Methods
/// <summary>
/// WCF proxys do not clean up properly if they throw an exception. This method ensures that the service proxy is handled correctly.
/// Do not call TService.Close() or TService.Abort() within the action lambda.
using System;
using System.Drawing;
using Console = Colorful.Console;
namespace lolcmd
{
class Program
{
private static Random random = new Random();