private void Close()
        {
            Log.Debug("Closing proxy connection to node");

            lock (_writeLock)
            {
                try
                {
                    if (_writer != null)
                    {
                        _writer.Flush();
                        _writer.Close();
                        _writer = null;
                    }
                }
                catch (Exception)
                {
                }


                if (_client != null)
                {
                    _client.Close();
                }

                _client = null;

                _networkHandler.Close();
            }
        }