public static void HandleClient(TcpClient client)
        {
            Task.Run(() =>
            {
                DeviceServer.logger.AppendLog("SL - Client Connected");

                while (true)
                {
                    CommandTransactionContainer ctc = null;

                    try
                    {
                        ctc = (CommandTransactionContainer)XMLSerdes.Decode(XMLSerdes.ReceivePacket(client, typeof(CommandTransactionContainer)), typeof(CommandTransactionContainer));
                    }
                    catch (Exception ex)
                    {
                        DeviceServer.logger.AppendLog("SL - An exception occured while attempting to deserialize received container.");

                        DeviceServer.logger.AppendLog(ex.Message);

                        break;
                    }

                    if (ctc != null)
                    {
                        DeviceServer.logger.AppendLog("SL - Opening Device Connection");

                        var connection = DeviceConnectionManager.GetConnecion(ctc.DeviceID);

                        var handles = connection.EnqueueCommands(ctc.ExpanderCommands);

                        var sw = new Stopwatch();
                        sw.Start();
                        var t       = new System.Timers.Timer(1000);
                        t.AutoReset = true;
                        t.Elapsed  += (a, b) => { DeviceServer.logger.AppendLog("SL - Waiting for command execution to complete." + TimeSpan.FromTicks(sw.ElapsedTicks).ToString()); };
                        t.Start();

                        foreach (var handle in handles)
                        {
                            handle.Handle.WaitOne();
                        }

                        sw.Stop();
                        t.Stop();

                        DeviceServer.logger.AppendLog("SL - Command Execution Complete");

                        var commands = handles.Select(x => x.Command).ToArray();

                        var r_ctc = new CommandTransactionContainer(ctc.DeviceID, commands);

                        try
                        {
                            XMLSerdes.SendPacket(client, r_ctc);
                        }
                        catch (Exception ex)
                        {
                            DeviceServer.logger.AppendLog("SL - An exception occured while attempting to serialize transmit container.");

                            DeviceServer.logger.AppendLog(ex.Message);

                            break;
                        }
                    }

                    break;
                }

                try
                {
                    if (client != null && client.Connected)
                    {
                        client.Close();
                    }
                }
                catch (Exception ex) { }
            });
        }