THRIFT-2768: Whitespace Fixup
Client: C#, Delphi
Patch: Jens Geyer
diff --git a/lib/csharp/src/Transport/TBufferedTransport.cs b/lib/csharp/src/Transport/TBufferedTransport.cs
index 6cb0457..89b9ca7 100644
--- a/lib/csharp/src/Transport/TBufferedTransport.cs
+++ b/lib/csharp/src/Transport/TBufferedTransport.cs
@@ -23,85 +23,85 @@
 namespace Thrift.Transport
 {
   public class TBufferedTransport : TTransport, IDisposable
-	{
-		private BufferedStream inputBuffer;
-		private BufferedStream outputBuffer;
-		private int bufSize;
-		private TStreamTransport transport;
+    {
+        private BufferedStream inputBuffer;
+        private BufferedStream outputBuffer;
+        private int bufSize;
+        private TStreamTransport transport;
 
-		public TBufferedTransport(TStreamTransport transport)
-			:this(transport, 1024)
-		{
+        public TBufferedTransport(TStreamTransport transport)
+            :this(transport, 1024)
+        {
 
-		}
+        }
 
-		public TBufferedTransport(TStreamTransport transport, int bufSize)
-		{
-			this.bufSize = bufSize;
-			this.transport = transport;
-			InitBuffers();
-		}
+        public TBufferedTransport(TStreamTransport transport, int bufSize)
+        {
+            this.bufSize = bufSize;
+            this.transport = transport;
+            InitBuffers();
+        }
 
-		private void InitBuffers()
-		{
-			if (transport.InputStream != null)
-			{
-				inputBuffer = new BufferedStream(transport.InputStream, bufSize);
-			}
-			if (transport.OutputStream != null)
-			{
-				outputBuffer = new BufferedStream(transport.OutputStream, bufSize);
-			}
-		}
+        private void InitBuffers()
+        {
+            if (transport.InputStream != null)
+            {
+                inputBuffer = new BufferedStream(transport.InputStream, bufSize);
+            }
+            if (transport.OutputStream != null)
+            {
+                outputBuffer = new BufferedStream(transport.OutputStream, bufSize);
+            }
+        }
 
-		private void CloseBuffers()
-		{
-			if (inputBuffer != null && inputBuffer.CanRead)
-			{
-				inputBuffer.Close();
-			}
-			if (outputBuffer != null && outputBuffer.CanWrite)
-			{
-				outputBuffer.Close();
-			}
-		}
+        private void CloseBuffers()
+        {
+            if (inputBuffer != null && inputBuffer.CanRead)
+            {
+                inputBuffer.Close();
+            }
+            if (outputBuffer != null && outputBuffer.CanWrite)
+            {
+                outputBuffer.Close();
+            }
+        }
 
-		public TTransport UnderlyingTransport
-		{
-			get { return transport; }
-		}
+        public TTransport UnderlyingTransport
+        {
+            get { return transport; }
+        }
 
-		public override bool IsOpen
-		{
-			get { return transport.IsOpen; }
-		}
+        public override bool IsOpen
+        {
+            get { return transport.IsOpen; }
+        }
 
-		public override void Open()
-		{
-			transport.Open();
-			InitBuffers();
-		}
+        public override void Open()
+        {
+            transport.Open();
+            InitBuffers();
+        }
 
-		public override void Close()
-		{
-			CloseBuffers();
-			transport.Close();
-		}
+        public override void Close()
+        {
+            CloseBuffers();
+            transport.Close();
+        }
 
-		public override int Read(byte[] buf, int off, int len)
-		{
-			return inputBuffer.Read(buf, off, len);
-		}
+        public override int Read(byte[] buf, int off, int len)
+        {
+            return inputBuffer.Read(buf, off, len);
+        }
 
-		public override void Write(byte[] buf, int off, int len)
-		{
-			outputBuffer.Write(buf, off, len);
-		}
+        public override void Write(byte[] buf, int off, int len)
+        {
+            outputBuffer.Write(buf, off, len);
+        }
 
-		public override void Flush()
-		{
-			outputBuffer.Flush();
-		}
+        public override void Flush()
+        {
+            outputBuffer.Flush();
+        }
 
     #region " IDisposable Support "
     private bool _IsDisposed;
diff --git a/lib/csharp/src/Transport/TFramedTransport.cs b/lib/csharp/src/Transport/TFramedTransport.cs
index aefbc09..8af227f 100644
--- a/lib/csharp/src/Transport/TFramedTransport.cs
+++ b/lib/csharp/src/Transport/TFramedTransport.cs
@@ -20,147 +20,147 @@
 using System.IO;
 
 namespace Thrift.Transport
-{ 
+{
   public class TFramedTransport : TTransport, IDisposable
-	{
-		protected TTransport transport = null;
-		protected MemoryStream writeBuffer;
-		protected MemoryStream readBuffer = null;
+    {
+        protected TTransport transport = null;
+        protected MemoryStream writeBuffer;
+        protected MemoryStream readBuffer = null;
 
-		private const int header_size = 4;
-		private static byte[] header_dummy = new byte[header_size]; // used as header placeholder while initilizing new write buffer
+        private const int header_size = 4;
+        private static byte[] header_dummy = new byte[header_size]; // used as header placeholder while initilizing new write buffer
 
-		public class Factory : TTransportFactory
-		{
-			public override TTransport GetTransport(TTransport trans)
-			{
-				return new TFramedTransport(trans);
-			}
-		}
+        public class Factory : TTransportFactory
+        {
+            public override TTransport GetTransport(TTransport trans)
+            {
+                return new TFramedTransport(trans);
+            }
+        }
 
-		protected TFramedTransport()
-		{
-			InitWriteBuffer();
-		}
+        protected TFramedTransport()
+        {
+            InitWriteBuffer();
+        }
 
-		public TFramedTransport(TTransport transport) : this()
-		{
-			this.transport = transport;
-		}
+        public TFramedTransport(TTransport transport) : this()
+        {
+            this.transport = transport;
+        }
 
-		public override void Open()
-		{
-			transport.Open();
-		}
+        public override void Open()
+        {
+            transport.Open();
+        }
 
-		public override bool IsOpen
-		{
-			get
-			{
-				return transport.IsOpen;
-			}
-		}
+        public override bool IsOpen
+        {
+            get
+            {
+                return transport.IsOpen;
+            }
+        }
 
-		public override void Close()
-		{
-			transport.Close();
-		}
+        public override void Close()
+        {
+            transport.Close();
+        }
 
-		public override int Read(byte[] buf, int off, int len)
-		{
-			if (readBuffer != null)
-			{
-				int got = readBuffer.Read(buf, off, len);
-				if (got > 0)
-				{
-					return got;
-				}
-			}
+        public override int Read(byte[] buf, int off, int len)
+        {
+            if (readBuffer != null)
+            {
+                int got = readBuffer.Read(buf, off, len);
+                if (got > 0)
+                {
+                    return got;
+                }
+            }
 
-			// Read another frame of data
-			ReadFrame();
+            // Read another frame of data
+            ReadFrame();
 
-			return readBuffer.Read(buf, off, len);
-		}
+            return readBuffer.Read(buf, off, len);
+        }
 
-		private void ReadFrame()
-		{
-			byte[] i32rd = new byte[header_size];
-			transport.ReadAll(i32rd, 0, header_size);
-			int size = DecodeFrameSize(i32rd);
+        private void ReadFrame()
+        {
+            byte[] i32rd = new byte[header_size];
+            transport.ReadAll(i32rd, 0, header_size);
+            int size = DecodeFrameSize(i32rd);
 
-			byte[] buff = new byte[size];
-			transport.ReadAll(buff, 0, size);
-			readBuffer = new MemoryStream(buff);
-		}
+            byte[] buff = new byte[size];
+            transport.ReadAll(buff, 0, size);
+            readBuffer = new MemoryStream(buff);
+        }
 
-		public override void Write(byte[] buf, int off, int len)
-		{
-			writeBuffer.Write(buf, off, len);
-		}
+        public override void Write(byte[] buf, int off, int len)
+        {
+            writeBuffer.Write(buf, off, len);
+        }
 
-		public override void Flush()
-		{
-			byte[] buf = writeBuffer.GetBuffer();
-			int len = (int)writeBuffer.Length;
-			int data_len = len - header_size;
-			if ( data_len < 0 )
-				throw new System.InvalidOperationException (); // logic error actually
+        public override void Flush()
+        {
+            byte[] buf = writeBuffer.GetBuffer();
+            int len = (int)writeBuffer.Length;
+            int data_len = len - header_size;
+            if ( data_len < 0 )
+                throw new System.InvalidOperationException (); // logic error actually
 
-			InitWriteBuffer();
+            InitWriteBuffer();
 
-			// Inject message header into the reserved buffer space
-			EncodeFrameSize(data_len,ref buf);
+            // Inject message header into the reserved buffer space
+            EncodeFrameSize(data_len,ref buf);
 
-			// Send the entire message at once
-			transport.Write(buf, 0, len);
+            // Send the entire message at once
+            transport.Write(buf, 0, len);
 
-			transport.Flush();
-		}
+            transport.Flush();
+        }
 
-		private void InitWriteBuffer ()
-		{
-			// Create new buffer instance
-			writeBuffer = new MemoryStream(1024);
+        private void InitWriteBuffer ()
+        {
+            // Create new buffer instance
+            writeBuffer = new MemoryStream(1024);
 
-			// Reserve space for message header to be put right before sending it out
-			writeBuffer.Write ( header_dummy, 0, header_size );
-		}
-		
-		private static void EncodeFrameSize(int frameSize, ref byte[] buf) 
-		{
-			buf[0] = (byte)(0xff & (frameSize >> 24));
-			buf[1] = (byte)(0xff & (frameSize >> 16));
-			buf[2] = (byte)(0xff & (frameSize >> 8));
-			buf[3] = (byte)(0xff & (frameSize));
-		}
-		
-		private static int DecodeFrameSize(byte[] buf)
-		{
-			return 
-				((buf[0] & 0xff) << 24) |
-				((buf[1] & 0xff) << 16) |
-				((buf[2] & 0xff) <<  8) |
-				((buf[3] & 0xff));
-		}
+            // Reserve space for message header to be put right before sending it out
+            writeBuffer.Write ( header_dummy, 0, header_size );
+        }
+
+        private static void EncodeFrameSize(int frameSize, ref byte[] buf)
+        {
+            buf[0] = (byte)(0xff & (frameSize >> 24));
+            buf[1] = (byte)(0xff & (frameSize >> 16));
+            buf[2] = (byte)(0xff & (frameSize >> 8));
+            buf[3] = (byte)(0xff & (frameSize));
+        }
+
+        private static int DecodeFrameSize(byte[] buf)
+        {
+            return
+                ((buf[0] & 0xff) << 24) |
+                ((buf[1] & 0xff) << 16) |
+                ((buf[2] & 0xff) <<  8) |
+                ((buf[3] & 0xff));
+        }
 
 
-		#region " IDisposable Support "
-		private bool _IsDisposed;
-		
-		// IDisposable
-		protected override void Dispose(bool disposing)
-		{
-			if (!_IsDisposed)
-			{
-				if (disposing)
-				{
-					if (readBuffer != null)
-						readBuffer.Dispose();
-				}
-			}
-			_IsDisposed = true;
-		}
-		#endregion
-	}
+        #region " IDisposable Support "
+        private bool _IsDisposed;
+
+        // IDisposable
+        protected override void Dispose(bool disposing)
+        {
+            if (!_IsDisposed)
+            {
+                if (disposing)
+                {
+                    if (readBuffer != null)
+                        readBuffer.Dispose();
+                }
+            }
+            _IsDisposed = true;
+        }
+        #endregion
+    }
 }
diff --git a/lib/csharp/src/Transport/THttpClient.cs b/lib/csharp/src/Transport/THttpClient.cs
index 1581e83..a56a3e8 100644
--- a/lib/csharp/src/Transport/THttpClient.cs
+++ b/lib/csharp/src/Transport/THttpClient.cs
@@ -7,7 +7,7 @@
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
  *
- *	 http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
@@ -15,8 +15,8 @@
  * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
- * 
+ *
+ *
  */
 
 using System;
@@ -48,40 +48,40 @@
         private IWebProxy proxy = WebRequest.DefaultWebProxy;
 #endif
 
-        public THttpClient(Uri u) 
+        public THttpClient(Uri u)
             : this(u, Enumerable.Empty<X509Certificate>())
-		{
-		}
+        {
+        }
 
-	    public THttpClient(Uri u, IEnumerable<X509Certificate> certificates)
-	    {
-	        uri = u;
+        public THttpClient(Uri u, IEnumerable<X509Certificate> certificates)
+        {
+            uri = u;
             this.certificates = (certificates ?? Enumerable.Empty<X509Certificate>()).ToArray();
-	    }
+        }
 
         public int ConnectTimeout
-		{
-			set
-			{
-			   connectTimeout = value;
-			}
-		}
+        {
+            set
+            {
+               connectTimeout = value;
+            }
+        }
 
-		public int ReadTimeout
-		{
-			set
-			{
-				readTimeout = value;
-			}
-		}
+        public int ReadTimeout
+        {
+            set
+            {
+                readTimeout = value;
+            }
+        }
 
-		public IDictionary<String, String> CustomHeaders
-		{
-			get
-			{
-				return customHeaders;
-			}
-		}
+        public IDictionary<String, String> CustomHeaders
+        {
+            get
+            {
+                return customHeaders;
+            }
+        }
 
 #if !SILVERLIGHT
         public IWebProxy Proxy
@@ -93,162 +93,162 @@
         }
 #endif
 
-		public override bool IsOpen
-		{
-			get
-			{
-				return true;
-			}
-		}
+        public override bool IsOpen
+        {
+            get
+            {
+                return true;
+            }
+        }
 
-		public override void Open()
-		{
-		}
+        public override void Open()
+        {
+        }
 
-		public override void Close()
-		{
-			if (inputStream != null)
-			{
-				inputStream.Close();
-				inputStream = null;
-			}
-			if (outputStream != null)
-			{
-				outputStream.Close();
-				outputStream = null;
-			}
-		}
+        public override void Close()
+        {
+            if (inputStream != null)
+            {
+                inputStream.Close();
+                inputStream = null;
+            }
+            if (outputStream != null)
+            {
+                outputStream.Close();
+                outputStream = null;
+            }
+        }
 
-		public override int Read(byte[] buf, int off, int len)
-		{
-			if (inputStream == null)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen, "No request has been sent");
-			}
+        public override int Read(byte[] buf, int off, int len)
+        {
+            if (inputStream == null)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen, "No request has been sent");
+            }
 
-			try
-			{
-				int ret = inputStream.Read(buf, off, len);
+            try
+            {
+                int ret = inputStream.Read(buf, off, len);
 
-				if (ret == -1)
-				{
-					throw new TTransportException(TTransportException.ExceptionType.EndOfFile, "No more data available");
-				}
+                if (ret == -1)
+                {
+                    throw new TTransportException(TTransportException.ExceptionType.EndOfFile, "No more data available");
+                }
 
-				return ret;
-			}
-			catch (IOException iox)
-			{ 
-				throw new TTransportException(TTransportException.ExceptionType.Unknown, iox.ToString());
-			}
-		}
+                return ret;
+            }
+            catch (IOException iox)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.Unknown, iox.ToString());
+            }
+        }
 
-		public override void Write(byte[] buf, int off, int len)
-		{
-			outputStream.Write(buf, off, len);
-		}
+        public override void Write(byte[] buf, int off, int len)
+        {
+            outputStream.Write(buf, off, len);
+        }
 
 #if !SILVERLIGHT
-		public override void Flush()
-		{
-			try 
-			{
-				SendRequest();
-			}
-			finally
-			{
-				outputStream = new MemoryStream();
-			}
-		}
+        public override void Flush()
+        {
+            try
+            {
+                SendRequest();
+            }
+            finally
+            {
+                outputStream = new MemoryStream();
+            }
+        }
 
-		private void SendRequest()
-		{
-			try
-			{
-				HttpWebRequest connection = CreateRequest();
+        private void SendRequest()
+        {
+            try
+            {
+                HttpWebRequest connection = CreateRequest();
 
-				byte[] data = outputStream.ToArray();
-				connection.ContentLength = data.Length;
+                byte[] data = outputStream.ToArray();
+                connection.ContentLength = data.Length;
 
-				using (Stream requestStream = connection.GetRequestStream())
-				{
-					requestStream.Write(data, 0, data.Length);
+                using (Stream requestStream = connection.GetRequestStream())
+                {
+                    requestStream.Write(data, 0, data.Length);
 
-					// Resolve HTTP hang that can happens after successive calls by making sure
-					// that we release the response and response stream. To support this, we copy
-					// the response to a memory stream.
-					using (var response = connection.GetResponse())
-					{
-						using (var responseStream = response.GetResponseStream())
-						{
-							// Copy the response to a memory stream so that we can
-							// cleanly close the response and response stream.
-							inputStream = new MemoryStream();
-							byte[] buffer = new byte[8096];
-							int bytesRead;
-							while ((bytesRead = responseStream.Read(buffer, 0, buffer.Length)) > 0)
-							{
-								inputStream.Write (buffer, 0, bytesRead);
-							}
-							inputStream.Seek(0, 0);
-						}
-					}
-				}
-			}
-			catch (IOException iox)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.Unknown, iox.ToString());
-			}
-			catch (WebException wx)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.Unknown, "Couldn't connect to server: " + wx);
-			}
-		}
+                    // Resolve HTTP hang that can happens after successive calls by making sure
+                    // that we release the response and response stream. To support this, we copy
+                    // the response to a memory stream.
+                    using (var response = connection.GetResponse())
+                    {
+                        using (var responseStream = response.GetResponseStream())
+                        {
+                            // Copy the response to a memory stream so that we can
+                            // cleanly close the response and response stream.
+                            inputStream = new MemoryStream();
+                            byte[] buffer = new byte[8096];
+                            int bytesRead;
+                            while ((bytesRead = responseStream.Read(buffer, 0, buffer.Length)) > 0)
+                            {
+                                inputStream.Write (buffer, 0, bytesRead);
+                            }
+                            inputStream.Seek(0, 0);
+                        }
+                    }
+                }
+            }
+            catch (IOException iox)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.Unknown, iox.ToString());
+            }
+            catch (WebException wx)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.Unknown, "Couldn't connect to server: " + wx);
+            }
+        }
 #endif
-		private HttpWebRequest CreateRequest()
-		{
-			HttpWebRequest connection = (HttpWebRequest)WebRequest.Create(uri);
+        private HttpWebRequest CreateRequest()
+        {
+            HttpWebRequest connection = (HttpWebRequest)WebRequest.Create(uri);
 
 
 #if !SILVERLIGHT
-			// Adding certificates through code is not supported with WP7 Silverlight
-			// see "Windows Phone 7 and Certificates_FINAL_121610.pdf"
-		    connection.ClientCertificates.AddRange(certificates);
+            // Adding certificates through code is not supported with WP7 Silverlight
+            // see "Windows Phone 7 and Certificates_FINAL_121610.pdf"
+            connection.ClientCertificates.AddRange(certificates);
 
-			if (connectTimeout > 0)
-			{
-				connection.Timeout = connectTimeout;
-			}
-			if (readTimeout > 0)
-			{
-				connection.ReadWriteTimeout = readTimeout;
-			}
+            if (connectTimeout > 0)
+            {
+                connection.Timeout = connectTimeout;
+            }
+            if (readTimeout > 0)
+            {
+                connection.ReadWriteTimeout = readTimeout;
+            }
 #endif
-			// Make the request
-			connection.ContentType = "application/x-thrift";
-			connection.Accept = "application/x-thrift";
-			connection.UserAgent = "C#/THttpClient";
-			connection.Method = "POST";
+            // Make the request
+            connection.ContentType = "application/x-thrift";
+            connection.Accept = "application/x-thrift";
+            connection.UserAgent = "C#/THttpClient";
+            connection.Method = "POST";
 #if !SILVERLIGHT
-			connection.ProtocolVersion = HttpVersion.Version10;
+            connection.ProtocolVersion = HttpVersion.Version10;
 #endif
 
             //add custom headers here
-			foreach (KeyValuePair<string, string> item in customHeaders)
-			{
+            foreach (KeyValuePair<string, string> item in customHeaders)
+            {
 #if !SILVERLIGHT
-				connection.Headers.Add(item.Key, item.Value);
+                connection.Headers.Add(item.Key, item.Value);
 #else
                 connection.Headers[item.Key] = item.Value;
 #endif
-			}
+            }
 
 #if !SILVERLIGHT
             connection.Proxy = proxy;
 #endif
 
             return connection;
-		}
+        }
 
         public override IAsyncResult BeginFlush(AsyncCallback callback, object state)
         {
@@ -388,12 +388,12 @@
             }
             internal void UpdateStatusToComplete()
             {
-                _isCompleted = true; //1. set _iscompleted to true 
+                _isCompleted = true; //1. set _iscompleted to true
                 lock (_locker)
                 {
                     if (_evt != null)
                     {
-                        _evt.Set(); //2. set the event, when it exists 
+                        _evt.Set(); //2. set the event, when it exists
                     }
                 }
             }
@@ -408,23 +408,23 @@
         }
 
 #region " IDisposable Support "
-		private bool _IsDisposed;
+        private bool _IsDisposed;
 
-		// IDisposable
-		protected override void Dispose(bool disposing)
-		{
-			if (!_IsDisposed)
-			{
-				if (disposing)
-				{
-					if (inputStream != null)
-						inputStream.Dispose();
-					if (outputStream != null)
-						outputStream.Dispose();
-				}
-			}
-			_IsDisposed = true;
-		}
+        // IDisposable
+        protected override void Dispose(bool disposing)
+        {
+            if (!_IsDisposed)
+            {
+                if (disposing)
+                {
+                    if (inputStream != null)
+                        inputStream.Dispose();
+                    if (outputStream != null)
+                        outputStream.Dispose();
+                }
+            }
+            _IsDisposed = true;
+        }
 #endregion
-	}
+    }
 }
diff --git a/lib/csharp/src/Transport/THttpHandler.cs b/lib/csharp/src/Transport/THttpHandler.cs
index 884f1ad..4115ef9 100644
--- a/lib/csharp/src/Transport/THttpHandler.cs
+++ b/lib/csharp/src/Transport/THttpHandler.cs
@@ -1,11 +1,23 @@
-//
-//  THttpHandler.cs
-//
-//  Authors:
-//		Fredrik Hedberg <fhedberg@availo.com>
-//
-//  Distributed under the Apache Public License
-//
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
 
 using System;
 using System.Web;
@@ -31,7 +43,7 @@
         {
 
         }
-        
+
         public THttpHandler(TProcessor processor, TProtocolFactory protocolFactory)
             : this(processor, protocolFactory, protocolFactory)
         {
diff --git a/lib/csharp/src/Transport/TMemoryBuffer.cs b/lib/csharp/src/Transport/TMemoryBuffer.cs
index ca31fee..d8ff9dc 100644
--- a/lib/csharp/src/Transport/TMemoryBuffer.cs
+++ b/lib/csharp/src/Transport/TMemoryBuffer.cs
@@ -23,77 +23,77 @@
 using Thrift.Protocol;
 
 namespace Thrift.Transport {
-	public class TMemoryBuffer : TTransport {
+    public class TMemoryBuffer : TTransport {
 
-		private readonly MemoryStream byteStream;
+        private readonly MemoryStream byteStream;
 
-		public TMemoryBuffer() {
-			byteStream = new MemoryStream();
-		}
+        public TMemoryBuffer() {
+            byteStream = new MemoryStream();
+        }
 
-		public TMemoryBuffer(byte[] buf) {
-			byteStream = new MemoryStream(buf);
-		}
+        public TMemoryBuffer(byte[] buf) {
+            byteStream = new MemoryStream(buf);
+        }
 
-		public override void Open() {
-			/** do nothing **/
-		}
+        public override void Open() {
+            /** do nothing **/
+        }
 
-		public override void Close() {
-			/** do nothing **/
-		}
+        public override void Close() {
+            /** do nothing **/
+        }
 
-		public override int Read(byte[] buf, int off, int len) {
-			return byteStream.Read(buf, off, len);
-		}
+        public override int Read(byte[] buf, int off, int len) {
+            return byteStream.Read(buf, off, len);
+        }
 
-		public override void Write(byte[] buf, int off, int len) {
-			byteStream.Write(buf, off, len);
-		}
+        public override void Write(byte[] buf, int off, int len) {
+            byteStream.Write(buf, off, len);
+        }
 
-		public byte[] GetBuffer() {
-			return byteStream.ToArray();
-		}
+        public byte[] GetBuffer() {
+            return byteStream.ToArray();
+        }
 
 
-		public override bool IsOpen {
-			get { return true; }
-		}
+        public override bool IsOpen {
+            get { return true; }
+        }
 
-		public static byte[] Serialize(TAbstractBase s) {
-			var t = new TMemoryBuffer();
-			var p = new TBinaryProtocol(t);
+        public static byte[] Serialize(TAbstractBase s) {
+            var t = new TMemoryBuffer();
+            var p = new TBinaryProtocol(t);
 
-			s.Write(p);
+            s.Write(p);
 
-			return t.GetBuffer();
-		}
+            return t.GetBuffer();
+        }
 
-		public static T DeSerialize<T>(byte[] buf) where T : TAbstractBase {
-			var trans = new TMemoryBuffer(buf);
-			var p = new TBinaryProtocol(trans);
-			if (typeof (TBase).IsAssignableFrom(typeof (T))) {
-				var method = typeof (T).GetMethod("Read", BindingFlags.Instance | BindingFlags.Public);
-				var t = Activator.CreateInstance<T>();
-				method.Invoke(t, new object[] {p});
-				return t;
-			 } else {
-			       var method = typeof (T).GetMethod("Read", BindingFlags.Static | BindingFlags.Public);
-				return (T) method.Invoke(null, new object[] {p});
-			}
-		}
+        public static T DeSerialize<T>(byte[] buf) where T : TAbstractBase {
+            var trans = new TMemoryBuffer(buf);
+            var p = new TBinaryProtocol(trans);
+            if (typeof (TBase).IsAssignableFrom(typeof (T))) {
+                var method = typeof (T).GetMethod("Read", BindingFlags.Instance | BindingFlags.Public);
+                var t = Activator.CreateInstance<T>();
+                method.Invoke(t, new object[] {p});
+                return t;
+             } else {
+                   var method = typeof (T).GetMethod("Read", BindingFlags.Static | BindingFlags.Public);
+                return (T) method.Invoke(null, new object[] {p});
+            }
+        }
 
-		private bool _IsDisposed;
+        private bool _IsDisposed;
 
-		// IDisposable
-		protected override void Dispose(bool disposing) {
-			if (!_IsDisposed) {
-				if (disposing) {
-					if (byteStream != null)
-						byteStream.Dispose();
-				}
-			}
-			_IsDisposed = true;
-		}
-	}
+        // IDisposable
+        protected override void Dispose(bool disposing) {
+            if (!_IsDisposed) {
+                if (disposing) {
+                    if (byteStream != null)
+                        byteStream.Dispose();
+                }
+            }
+            _IsDisposed = true;
+        }
+    }
 }
\ No newline at end of file
diff --git a/lib/csharp/src/Transport/TNamedPipeClientTransport.cs b/lib/csharp/src/Transport/TNamedPipeClientTransport.cs
index 7dafdd6..9faa6e7 100644
--- a/lib/csharp/src/Transport/TNamedPipeClientTransport.cs
+++ b/lib/csharp/src/Transport/TNamedPipeClientTransport.cs
@@ -25,71 +25,71 @@
 
 namespace Thrift.Transport
 {
-	public class TNamedPipeClientTransport : TTransport
-	{
-		private NamedPipeClientStream client;
-		private string ServerName;
-		private string PipeName;
+    public class TNamedPipeClientTransport : TTransport
+    {
+        private NamedPipeClientStream client;
+        private string ServerName;
+        private string PipeName;
 
-		public TNamedPipeClientTransport(string pipe)
-		{
-			ServerName = ".";
-			PipeName = pipe;
-		}
+        public TNamedPipeClientTransport(string pipe)
+        {
+            ServerName = ".";
+            PipeName = pipe;
+        }
 
-		public TNamedPipeClientTransport(string server, string pipe)
-		{
-			ServerName = (server != "") ? server : ".";
-			PipeName = pipe;
-		}
+        public TNamedPipeClientTransport(string server, string pipe)
+        {
+            ServerName = (server != "") ? server : ".";
+            PipeName = pipe;
+        }
 
-		public override bool IsOpen
-		{
-			get { return client != null && client.IsConnected; }
-		}
+        public override bool IsOpen
+        {
+            get { return client != null && client.IsConnected; }
+        }
 
-		public override void Open()
-		{
-			if (IsOpen)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.AlreadyOpen);
-			}
-			client = new NamedPipeClientStream(ServerName, PipeName, PipeDirection.InOut, PipeOptions.None);
-			client.Connect();
-		}
+        public override void Open()
+        {
+            if (IsOpen)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.AlreadyOpen);
+            }
+            client = new NamedPipeClientStream(ServerName, PipeName, PipeDirection.InOut, PipeOptions.None);
+            client.Connect();
+        }
 
-		public override void Close()
-		{
-			if (client != null)
-			{
-				client.Close();
-				client = null;
-			}
-		}
+        public override void Close()
+        {
+            if (client != null)
+            {
+                client.Close();
+                client = null;
+            }
+        }
 
-		public override int Read(byte[] buf, int off, int len)
-		{
-			if (client == null)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen);
-			}
+        public override int Read(byte[] buf, int off, int len)
+        {
+            if (client == null)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen);
+            }
 
-			return client.Read(buf, off, len);
-		}
+            return client.Read(buf, off, len);
+        }
 
-		public override void Write(byte[] buf, int off, int len)
-		{
-			if (client == null)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen);
-			}
+        public override void Write(byte[] buf, int off, int len)
+        {
+            if (client == null)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen);
+            }
 
-			client.Write(buf, off, len);
-		}
+            client.Write(buf, off, len);
+        }
 
-		protected override void Dispose(bool disposing)
-		{
-			client.Dispose();
-		}
-	}
+        protected override void Dispose(bool disposing)
+        {
+            client.Dispose();
+        }
+    }
 }
\ No newline at end of file
diff --git a/lib/csharp/src/Transport/TNamedPipeServerTransport.cs b/lib/csharp/src/Transport/TNamedPipeServerTransport.cs
index 815af19..b3f34eb 100644
--- a/lib/csharp/src/Transport/TNamedPipeServerTransport.cs
+++ b/lib/csharp/src/Transport/TNamedPipeServerTransport.cs
@@ -27,110 +27,110 @@
 
 namespace Thrift.Transport
 {
-	public class TNamedPipeServerTransport : TServerTransport
-	{
-		/// <summary>
-		/// This is the address of the Pipe on the localhost.
-		/// </summary>
-		private readonly string pipeAddress;
-		NamedPipeServerStream stream = null;
+    public class TNamedPipeServerTransport : TServerTransport
+    {
+        /// <summary>
+        /// This is the address of the Pipe on the localhost.
+        /// </summary>
+        private readonly string pipeAddress;
+        NamedPipeServerStream stream = null;
 
-		public TNamedPipeServerTransport(string pipeAddress)
-		{
-			this.pipeAddress = pipeAddress;
-		}
+        public TNamedPipeServerTransport(string pipeAddress)
+        {
+            this.pipeAddress = pipeAddress;
+        }
 
-		public override void Listen()
-		{
-			// nothing to do here
-		}
+        public override void Listen()
+        {
+            // nothing to do here
+        }
 
-		public override void Close()
-		{
-			if (stream != null)
-			{
-				try
-				{
-					stream.Close();
-					stream.Dispose();
-				}
-				finally
-				{
-					stream = null;
-				}
-			}
-		}
+        public override void Close()
+        {
+            if (stream != null)
+            {
+                try
+                {
+                    stream.Close();
+                    stream.Dispose();
+                }
+                finally
+                {
+                    stream = null;
+                }
+            }
+        }
 
-		private void EnsurePipeInstance()
-		{
-			if( stream == null)
-				stream = new NamedPipeServerStream(
-					pipeAddress, PipeDirection.InOut, 254,
-					PipeTransmissionMode.Byte,
-					PipeOptions.None, 4096, 4096 /*TODO: security*/);
-		}
+        private void EnsurePipeInstance()
+        {
+            if( stream == null)
+                stream = new NamedPipeServerStream(
+                    pipeAddress, PipeDirection.InOut, 254,
+                    PipeTransmissionMode.Byte,
+                    PipeOptions.None, 4096, 4096 /*TODO: security*/);
+        }
 
-		protected override TTransport AcceptImpl()
-		{
-			try
-			{
-				EnsurePipeInstance();
-				stream.WaitForConnection();
-				var trans = new ServerTransport(stream);
-				stream = null;  // pass ownership to ServerTransport
-				return trans;
-			}
-			catch (Exception e)
-			{
-				Close();
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen, e.Message);
-			}
-		}
+        protected override TTransport AcceptImpl()
+        {
+            try
+            {
+                EnsurePipeInstance();
+                stream.WaitForConnection();
+                var trans = new ServerTransport(stream);
+                stream = null;  // pass ownership to ServerTransport
+                return trans;
+            }
+            catch (Exception e)
+            {
+                Close();
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen, e.Message);
+            }
+        }
 
-		private class ServerTransport : TTransport
-		{
-			private NamedPipeServerStream server;
-			public ServerTransport(NamedPipeServerStream server)
-			{
-				this.server = server;
-			}
+        private class ServerTransport : TTransport
+        {
+            private NamedPipeServerStream server;
+            public ServerTransport(NamedPipeServerStream server)
+            {
+                this.server = server;
+            }
 
-			public override bool IsOpen
-			{
-				get { return server != null && server.IsConnected; }
-			}
+            public override bool IsOpen
+            {
+                get { return server != null && server.IsConnected; }
+            }
 
-			public override void Open()
-			{
-			}
+            public override void Open()
+            {
+            }
 
-			public override void Close()
-			{
-				if (server != null) server.Close();
-			}
+            public override void Close()
+            {
+                if (server != null) server.Close();
+            }
 
-			public override int Read(byte[] buf, int off, int len)
-			{
-				if (server == null)
-				{
-					throw new TTransportException(TTransportException.ExceptionType.NotOpen);
-				}
-				return server.Read(buf, off, len);
-			}
+            public override int Read(byte[] buf, int off, int len)
+            {
+                if (server == null)
+                {
+                    throw new TTransportException(TTransportException.ExceptionType.NotOpen);
+                }
+                return server.Read(buf, off, len);
+            }
 
-			public override void Write(byte[] buf, int off, int len)
-			{
-				if (server == null)
-				{
-					throw new TTransportException(TTransportException.ExceptionType.NotOpen);
-				}
-				server.Write(buf, off, len);
-			}
+            public override void Write(byte[] buf, int off, int len)
+            {
+                if (server == null)
+                {
+                    throw new TTransportException(TTransportException.ExceptionType.NotOpen);
+                }
+                server.Write(buf, off, len);
+            }
 
-			protected override void Dispose(bool disposing)
-			{
-				server.Dispose();
-			}
-		}
-	}
+            protected override void Dispose(bool disposing)
+            {
+                server.Dispose();
+            }
+        }
+    }
 }
\ No newline at end of file
diff --git a/lib/csharp/src/Transport/TServerSocket.cs b/lib/csharp/src/Transport/TServerSocket.cs
index eefa4f9..82a367c 100644
--- a/lib/csharp/src/Transport/TServerSocket.cs
+++ b/lib/csharp/src/Transport/TServerSocket.cs
@@ -27,94 +27,94 @@
 
 namespace Thrift.Transport
 {
-	public class TServerSocket : TServerTransport
-	{
-		/**
-		* Underlying server with socket
-		*/
-		private TcpListener server = null;
+    public class TServerSocket : TServerTransport
+    {
+        /**
+        * Underlying server with socket
+        */
+        private TcpListener server = null;
 
-		/**
-		 * Port to listen on
-		 */
-		private int port = 0;
+        /**
+         * Port to listen on
+         */
+        private int port = 0;
 
-		/**
-		 * Timeout for client sockets from accept
-		 */
-		private int clientTimeout = 0;
+        /**
+         * Timeout for client sockets from accept
+         */
+        private int clientTimeout = 0;
 
-		/**
-		 * Whether or not to wrap new TSocket connections in buffers
-		 */
-		private bool useBufferedSockets = false;
+        /**
+         * Whether or not to wrap new TSocket connections in buffers
+         */
+        private bool useBufferedSockets = false;
 
-		/**
-		 * Creates a server socket from underlying socket object
-		 */
-		public TServerSocket(TcpListener listener)
-			:this(listener, 0)
-		{
-		}
+        /**
+         * Creates a server socket from underlying socket object
+         */
+        public TServerSocket(TcpListener listener)
+            :this(listener, 0)
+        {
+        }
 
-		/**
-		 * Creates a server socket from underlying socket object
-		 */
-		public TServerSocket(TcpListener listener, int clientTimeout)
-		{
-			this.server = listener;
-			this.clientTimeout = clientTimeout;
-		}
+        /**
+         * Creates a server socket from underlying socket object
+         */
+        public TServerSocket(TcpListener listener, int clientTimeout)
+        {
+            this.server = listener;
+            this.clientTimeout = clientTimeout;
+        }
 
-		/**
-		 * Creates just a port listening server socket
-		 */
-		public TServerSocket(int port)
-			: this(port, 0)
-		{
-		}
+        /**
+         * Creates just a port listening server socket
+         */
+        public TServerSocket(int port)
+            : this(port, 0)
+        {
+        }
 
-		/**
-		 * Creates just a port listening server socket
-		 */
-		public TServerSocket(int port, int clientTimeout)
-			:this(port, clientTimeout, false)
-		{
-		}
+        /**
+         * Creates just a port listening server socket
+         */
+        public TServerSocket(int port, int clientTimeout)
+            :this(port, clientTimeout, false)
+        {
+        }
 
-		public TServerSocket(int port, int clientTimeout, bool useBufferedSockets)
-		{
-			this.port = port;
-			this.clientTimeout = clientTimeout;
-			this.useBufferedSockets = useBufferedSockets;
-			try
-			{
-				// Make server socket
-				server = new TcpListener(System.Net.IPAddress.Any, this.port);
-				server.Server.NoDelay = true;
-			}
-			catch (Exception)
-			{
-				server = null;
-				throw new TTransportException("Could not create ServerSocket on port " + port + ".");
-			}
-		}
+        public TServerSocket(int port, int clientTimeout, bool useBufferedSockets)
+        {
+            this.port = port;
+            this.clientTimeout = clientTimeout;
+            this.useBufferedSockets = useBufferedSockets;
+            try
+            {
+                // Make server socket
+                server = new TcpListener(System.Net.IPAddress.Any, this.port);
+                server.Server.NoDelay = true;
+            }
+            catch (Exception)
+            {
+                server = null;
+                throw new TTransportException("Could not create ServerSocket on port " + port + ".");
+            }
+        }
 
-		public override void Listen()
-		{
-			// Make sure not to block on accept
-			if (server != null)
-			{
-				try
-				{
-					server.Start();
-				}
-				catch (SocketException sx)
-				{
-					throw new TTransportException("Could not accept on listening socket: " + sx.Message);
-				}
-			}
-		}
+        public override void Listen()
+        {
+            // Make sure not to block on accept
+            if (server != null)
+            {
+                try
+                {
+                    server.Start();
+                }
+                catch (SocketException sx)
+                {
+                    throw new TTransportException("Could not accept on listening socket: " + sx.Message);
+                }
+            }
+        }
 
         protected override TTransport AcceptImpl()
         {
@@ -142,7 +142,7 @@
                 }
                 catch (System.Exception)
                 {
-                    // If a TSocket was successfully created, then let 
+                    // If a TSocket was successfully created, then let
                     // it do proper cleanup of the TcpClient object.
                     if (result2 != null)
                         result2.Dispose();
@@ -158,19 +158,19 @@
         }
 
         public override void Close()
-		{
-			if (server != null)
-			{
-				try
-				{
-					server.Stop();
-				}
-				catch (Exception ex)
-				{
-					throw new TTransportException("WARNING: Could not close server socket: " + ex);
-				}
-				server = null;
-			}
-		}
-	}
+        {
+            if (server != null)
+            {
+                try
+                {
+                    server.Stop();
+                }
+                catch (Exception ex)
+                {
+                    throw new TTransportException("WARNING: Could not close server socket: " + ex);
+                }
+                server = null;
+            }
+        }
+    }
 }
diff --git a/lib/csharp/src/Transport/TServerTransport.cs b/lib/csharp/src/Transport/TServerTransport.cs
index c99d07f..05d7d0f 100644
--- a/lib/csharp/src/Transport/TServerTransport.cs
+++ b/lib/csharp/src/Transport/TServerTransport.cs
@@ -25,19 +25,19 @@
 
 namespace Thrift.Transport
 {
-	public abstract class TServerTransport
-	{
-		public abstract void Listen();
-		public abstract void Close();
-		protected abstract TTransport AcceptImpl();
+    public abstract class TServerTransport
+    {
+        public abstract void Listen();
+        public abstract void Close();
+        protected abstract TTransport AcceptImpl();
 
-		public TTransport Accept()
-		{
-			TTransport transport = AcceptImpl();
-			if (transport == null) {
-			  throw new TTransportException("accept() may not return NULL");
-			}
-			return transport;
-		 }
-	}
+        public TTransport Accept()
+        {
+            TTransport transport = AcceptImpl();
+            if (transport == null) {
+              throw new TTransportException("accept() may not return NULL");
+            }
+            return transport;
+         }
+    }
 }
diff --git a/lib/csharp/src/Transport/TSocket.cs b/lib/csharp/src/Transport/TSocket.cs
index 35fbe97..cf1a440 100644
--- a/lib/csharp/src/Transport/TSocket.cs
+++ b/lib/csharp/src/Transport/TSocket.cs
@@ -26,118 +26,118 @@
 
 namespace Thrift.Transport
 {
-	public class TSocket : TStreamTransport
-	{
-		private TcpClient client = null;
-		private string host = null;
-		private int port = 0;
-		private int timeout = 0;
+    public class TSocket : TStreamTransport
+    {
+        private TcpClient client = null;
+        private string host = null;
+        private int port = 0;
+        private int timeout = 0;
 
-		public TSocket(TcpClient client)
-		{
-			this.client = client;
+        public TSocket(TcpClient client)
+        {
+            this.client = client;
 
-			if (IsOpen)
-			{
-				inputStream = client.GetStream();
-				outputStream = client.GetStream();
-			}
-		}
+            if (IsOpen)
+            {
+                inputStream = client.GetStream();
+                outputStream = client.GetStream();
+            }
+        }
 
-		public TSocket(string host, int port) 
-		    : this(host, port, 0)
-		{
-		}
+        public TSocket(string host, int port)
+            : this(host, port, 0)
+        {
+        }
 
-		public TSocket(string host, int port, int timeout)
-		{
-			this.host = host;
-			this.port = port;
-			this.timeout = timeout;
+        public TSocket(string host, int port, int timeout)
+        {
+            this.host = host;
+            this.port = port;
+            this.timeout = timeout;
 
-			InitSocket();
-		}
+            InitSocket();
+        }
 
-		private void InitSocket()
-		{
-			client = new TcpClient();
-			client.ReceiveTimeout = client.SendTimeout = timeout;
-			client.Client.NoDelay = true;
-		}
+        private void InitSocket()
+        {
+            client = new TcpClient();
+            client.ReceiveTimeout = client.SendTimeout = timeout;
+            client.Client.NoDelay = true;
+        }
 
-		public int Timeout
-		{
-			set
-			{
-				client.ReceiveTimeout = client.SendTimeout = timeout = value;
-			}
-		}
+        public int Timeout
+        {
+            set
+            {
+                client.ReceiveTimeout = client.SendTimeout = timeout = value;
+            }
+        }
 
-		public TcpClient TcpClient
-		{
-			get
-			{
-				return client;
-			}
-		}
+        public TcpClient TcpClient
+        {
+            get
+            {
+                return client;
+            }
+        }
 
-		public string Host
-		{
-			get
-			{
-				return host;
-			}
-		}
+        public string Host
+        {
+            get
+            {
+                return host;
+            }
+        }
 
-		public int Port
-		{
-			get
-			{
-				return port;
-			}
-		}
+        public int Port
+        {
+            get
+            {
+                return port;
+            }
+        }
 
-		public override bool IsOpen
-		{
-			get
-			{
-				if (client == null)
-				{
-					return false;
-				}
+        public override bool IsOpen
+        {
+            get
+            {
+                if (client == null)
+                {
+                    return false;
+                }
 
-				return client.Connected;
-			}
-		}
+                return client.Connected;
+            }
+        }
 
-		public override void Open()
-		{
-			if (IsOpen)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.AlreadyOpen, "Socket already connected");
-			}
+        public override void Open()
+        {
+            if (IsOpen)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.AlreadyOpen, "Socket already connected");
+            }
 
-			if (String.IsNullOrEmpty(host))
-			{
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot open null host");
-			}
+            if (String.IsNullOrEmpty(host))
+            {
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot open null host");
+            }
 
-			if (port <= 0)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot open without port");
-			}
+            if (port <= 0)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot open without port");
+            }
 
-			if (client == null)
-			{
-				InitSocket();
-			}
+            if (client == null)
+            {
+                InitSocket();
+            }
 
-			if( timeout == 0)			// no timeout -> infinite
-			{
-				client.Connect(host, port);
-			}
-			else                        // we have a timeout -> use it
-			{
+            if( timeout == 0)            // no timeout -> infinite
+            {
+                client.Connect(host, port);
+            }
+            else                        // we have a timeout -> use it
+            {
                 ConnectHelper hlp = new ConnectHelper(client);
                 IAsyncResult asyncres = client.BeginConnect(host, port, new AsyncCallback(ConnectCallback), hlp);
                 bool bConnected = asyncres.AsyncWaitHandle.WaitOne(timeout) && client.Connected;
@@ -158,11 +158,11 @@
                     }
                     throw new TTransportException(TTransportException.ExceptionType.TimedOut, "Connect timed out");
                 }
-			}
+            }
 
-			inputStream = client.GetStream();
-			outputStream = client.GetStream();
-		}
+            inputStream = client.GetStream();
+            outputStream = client.GetStream();
+        }
 
 
         static void ConnectCallback(IAsyncResult asyncres)
@@ -171,7 +171,7 @@
             lock (hlp.Mutex)
             {
                 hlp.CallbackDone = true;
-                    
+
                 try
                 {
                     if( hlp.Client.Client != null)
@@ -182,16 +182,16 @@
                     // catch that away
                 }
 
-                if (hlp.DoCleanup) 
+                if (hlp.DoCleanup)
                 {
-                	try {
-                    	asyncres.AsyncWaitHandle.Close();
-                	} catch (Exception) {}
-                	
-                	try {
-                    	if (hlp.Client is IDisposable)
-	                        ((IDisposable)hlp.Client).Dispose();
-                	} catch (Exception) {}
+                    try {
+                        asyncres.AsyncWaitHandle.Close();
+                    } catch (Exception) {}
+
+                    try {
+                        if (hlp.Client is IDisposable)
+                            ((IDisposable)hlp.Client).Dispose();
+                    } catch (Exception) {}
                     hlp.Client = null;
                 }
             }
@@ -209,15 +209,15 @@
             }
         }
 
-		public override void Close()
-		{
-			base.Close();
-			if (client != null)
-			{
-				client.Close();
-				client = null;
-			}
-		}
+        public override void Close()
+        {
+            base.Close();
+            if (client != null)
+            {
+                client.Close();
+                client = null;
+            }
+        }
 
     #region " IDisposable Support "
     private bool _IsDisposed;
diff --git a/lib/csharp/src/Transport/TStreamTransport.cs b/lib/csharp/src/Transport/TStreamTransport.cs
index eb1d2cc..468743c 100644
--- a/lib/csharp/src/Transport/TStreamTransport.cs
+++ b/lib/csharp/src/Transport/TStreamTransport.cs
@@ -26,83 +26,83 @@
 
 namespace Thrift.Transport
 {
-	public class TStreamTransport : TTransport
-	{
-		protected Stream inputStream;
-		protected Stream outputStream;
+    public class TStreamTransport : TTransport
+    {
+        protected Stream inputStream;
+        protected Stream outputStream;
 
-		protected TStreamTransport()
-		{
-		}
+        protected TStreamTransport()
+        {
+        }
 
-		public TStreamTransport(Stream inputStream, Stream outputStream)
-		{
-			this.inputStream = inputStream;
-			this.outputStream = outputStream;
-		}
+        public TStreamTransport(Stream inputStream, Stream outputStream)
+        {
+            this.inputStream = inputStream;
+            this.outputStream = outputStream;
+        }
 
-		public Stream OutputStream
-		{
-			get { return outputStream; }
-		}
+        public Stream OutputStream
+        {
+            get { return outputStream; }
+        }
 
-		public Stream InputStream
-		{
-			get { return inputStream; }
-		}
+        public Stream InputStream
+        {
+            get { return inputStream; }
+        }
 
-		public override bool IsOpen
-		{
-			get { return true; }
-		}
+        public override bool IsOpen
+        {
+            get { return true; }
+        }
 
-		public override void Open()
-		{
-		}
+        public override void Open()
+        {
+        }
 
-		public override void Close()
-		{
-			if (inputStream != null)
-			{
-				inputStream.Close();
-				inputStream = null;
-			}
-			if (outputStream != null)
-			{
-				outputStream.Close();
-				outputStream = null;
-			}
-		}
+        public override void Close()
+        {
+            if (inputStream != null)
+            {
+                inputStream.Close();
+                inputStream = null;
+            }
+            if (outputStream != null)
+            {
+                outputStream.Close();
+                outputStream = null;
+            }
+        }
 
-		public override int Read(byte[] buf, int off, int len)
-		{
-			if (inputStream == null)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot read from null inputstream");
-			}
+        public override int Read(byte[] buf, int off, int len)
+        {
+            if (inputStream == null)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot read from null inputstream");
+            }
 
-			return inputStream.Read(buf, off, len);
-		}
+            return inputStream.Read(buf, off, len);
+        }
 
-		public override void Write(byte[] buf, int off, int len)
-		{
-			if (outputStream == null)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot write to null outputstream");
-			}
+        public override void Write(byte[] buf, int off, int len)
+        {
+            if (outputStream == null)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot write to null outputstream");
+            }
 
-			outputStream.Write(buf, off, len);
-		}
+            outputStream.Write(buf, off, len);
+        }
 
-		public override void Flush()
-		{
-			if (outputStream == null)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot flush null outputstream");
-			}
+        public override void Flush()
+        {
+            if (outputStream == null)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot flush null outputstream");
+            }
 
-			outputStream.Flush();
-		}
+            outputStream.Flush();
+        }
 
 
     #region " IDisposable Support "
diff --git a/lib/csharp/src/Transport/TTLSServerSocket.cs b/lib/csharp/src/Transport/TTLSServerSocket.cs
index 948b1d7..9753d47 100644
--- a/lib/csharp/src/Transport/TTLSServerSocket.cs
+++ b/lib/csharp/src/Transport/TTLSServerSocket.cs
@@ -23,164 +23,164 @@
 
 namespace Thrift.Transport
 {
-	/// <summary>
-	/// SSL Server Socket Wrapper Class
-	/// </summary>
-	public class TTLSServerSocket : TServerTransport
-	{
-		/// <summary>
-		/// Underlying tcp server
-		/// </summary>
-		private TcpListener server = null;
+    /// <summary>
+    /// SSL Server Socket Wrapper Class
+    /// </summary>
+    public class TTLSServerSocket : TServerTransport
+    {
+        /// <summary>
+        /// Underlying tcp server
+        /// </summary>
+        private TcpListener server = null;
 
-		/// <summary>
-		/// The port where the socket listen
-		/// </summary>
-		private int port = 0;
+        /// <summary>
+        /// The port where the socket listen
+        /// </summary>
+        private int port = 0;
 
-		/// <summary>
-		/// Timeout for the created server socket
-		/// </summary>
-		private int clientTimeout = 0;
+        /// <summary>
+        /// Timeout for the created server socket
+        /// </summary>
+        private int clientTimeout = 0;
 
-		/// <summary>
-		/// Whether or not to wrap new TSocket connections in buffers
-		/// </summary>
-		private bool useBufferedSockets = false;
+        /// <summary>
+        /// Whether or not to wrap new TSocket connections in buffers
+        /// </summary>
+        private bool useBufferedSockets = false;
 
-		/// <summary>
-		/// The servercertificate with the private- and public-key
-		/// </summary>
-		private X509Certificate serverCertificate;
+        /// <summary>
+        /// The servercertificate with the private- and public-key
+        /// </summary>
+        private X509Certificate serverCertificate;
 
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="TTLSServerSocket" /> class.
-		/// </summary>
-		/// <param name="port">The port where the server runs.</param>
-		/// <param name="certificate">The certificate object.</param>
-		public TTLSServerSocket(int port, X509Certificate2 certificate)
-			: this(port,  0, certificate)
-		{
-		}
+        /// <summary>
+        /// Initializes a new instance of the <see cref="TTLSServerSocket" /> class.
+        /// </summary>
+        /// <param name="port">The port where the server runs.</param>
+        /// <param name="certificate">The certificate object.</param>
+        public TTLSServerSocket(int port, X509Certificate2 certificate)
+            : this(port,  0, certificate)
+        {
+        }
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="TTLSServerSocket" /> class.
-		/// </summary>
-		/// <param name="port">The port where the server runs.</param>
-		/// <param name="clientTimeout">Send/receive timeout.</param>
-		/// <param name="certificate">The certificate object.</param>
-		public TTLSServerSocket(int port, int clientTimeout, X509Certificate2 certificate)
-			: this(port, clientTimeout, false, certificate)
-		{
-		}
+        /// <summary>
+        /// Initializes a new instance of the <see cref="TTLSServerSocket" /> class.
+        /// </summary>
+        /// <param name="port">The port where the server runs.</param>
+        /// <param name="clientTimeout">Send/receive timeout.</param>
+        /// <param name="certificate">The certificate object.</param>
+        public TTLSServerSocket(int port, int clientTimeout, X509Certificate2 certificate)
+            : this(port, clientTimeout, false, certificate)
+        {
+        }
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="TTLSServerSocket" /> class.
-		/// </summary>
-		/// <param name="port">The port where the server runs.</param>
-		/// <param name="clientTimeout">Send/receive timeout.</param>
-		/// <param name="useBufferedSockets">If set to <c>true</c> [use buffered sockets].</param>
-		/// <param name="certificate">The certificate object.</param>
-		public TTLSServerSocket(int port, int clientTimeout, bool useBufferedSockets, X509Certificate2 certificate)
-		{
-			if (!certificate.HasPrivateKey)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.Unknown, "Your server-certificate needs to have a private key");
-			}
+        /// <summary>
+        /// Initializes a new instance of the <see cref="TTLSServerSocket" /> class.
+        /// </summary>
+        /// <param name="port">The port where the server runs.</param>
+        /// <param name="clientTimeout">Send/receive timeout.</param>
+        /// <param name="useBufferedSockets">If set to <c>true</c> [use buffered sockets].</param>
+        /// <param name="certificate">The certificate object.</param>
+        public TTLSServerSocket(int port, int clientTimeout, bool useBufferedSockets, X509Certificate2 certificate)
+        {
+            if (!certificate.HasPrivateKey)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.Unknown, "Your server-certificate needs to have a private key");
+            }
 
-			this.port = port;
-			this.serverCertificate = certificate;
-			this.useBufferedSockets = useBufferedSockets;
-			try
-			{
-				// Create server socket
-				server = new TcpListener(System.Net.IPAddress.Any, this.port);
-				server.Server.NoDelay = true;
-			}
-			catch (Exception)
-			{
-				server = null;
-				throw new TTransportException("Could not create ServerSocket on port " + port + ".");
-			}
-		}
+            this.port = port;
+            this.serverCertificate = certificate;
+            this.useBufferedSockets = useBufferedSockets;
+            try
+            {
+                // Create server socket
+                server = new TcpListener(System.Net.IPAddress.Any, this.port);
+                server.Server.NoDelay = true;
+            }
+            catch (Exception)
+            {
+                server = null;
+                throw new TTransportException("Could not create ServerSocket on port " + port + ".");
+            }
+        }
 
-		/// <summary>
-		/// Starts the server.
-		/// </summary>
-		public override void Listen()
-		{
-			// Make sure accept is not blocking
-			if (this.server != null)
-			{
-				try
-				{
-					this.server.Start();
-				}
-				catch (SocketException sx)
-				{
-					throw new TTransportException("Could not accept on listening socket: " + sx.Message);
-				}
-			}
-		}
+        /// <summary>
+        /// Starts the server.
+        /// </summary>
+        public override void Listen()
+        {
+            // Make sure accept is not blocking
+            if (this.server != null)
+            {
+                try
+                {
+                    this.server.Start();
+                }
+                catch (SocketException sx)
+                {
+                    throw new TTransportException("Could not accept on listening socket: " + sx.Message);
+                }
+            }
+        }
 
-		/// <summary>
-		/// Callback for Accept Implementation
-		/// </summary>
-		/// <returns>
-		/// TTransport-object.
-		/// </returns>
-		protected override TTransport AcceptImpl()
-		{
-			if (this.server == null)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen, "No underlying server socket.");
-			}
+        /// <summary>
+        /// Callback for Accept Implementation
+        /// </summary>
+        /// <returns>
+        /// TTransport-object.
+        /// </returns>
+        protected override TTransport AcceptImpl()
+        {
+            if (this.server == null)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen, "No underlying server socket.");
+            }
 
-			try
-			{
-				TcpClient client = this.server.AcceptTcpClient();
-				client.SendTimeout = client.ReceiveTimeout = this.clientTimeout;
+            try
+            {
+                TcpClient client = this.server.AcceptTcpClient();
+                client.SendTimeout = client.ReceiveTimeout = this.clientTimeout;
 
-				//wrap the client in an SSL Socket passing in the SSL cert
-				TTLSSocket socket = new TTLSSocket(client, this.serverCertificate, true);
+                //wrap the client in an SSL Socket passing in the SSL cert
+                TTLSSocket socket = new TTLSSocket(client, this.serverCertificate, true);
 
-				socket.setupTLS();
+                socket.setupTLS();
 
-				if (useBufferedSockets)
-				{
-					TBufferedTransport trans = new TBufferedTransport(socket);
-					return trans;
-				}
-				else
-				{
-					return socket;
-				}
-				
-			}
-			catch (Exception ex)
-			{
-				throw new TTransportException(ex.ToString());
-			}
-		}
+                if (useBufferedSockets)
+                {
+                    TBufferedTransport trans = new TBufferedTransport(socket);
+                    return trans;
+                }
+                else
+                {
+                    return socket;
+                }
 
-		/// <summary>
-		/// Stops the Server
-		/// </summary>
-		public override void Close()
-		{
-			if (this.server != null)
-			{
-				try
-				{
-					this.server.Stop();
-				}
-				catch (Exception ex)  
-				{
-					throw new TTransportException("WARNING: Could not close server socket: " + ex);
-				}
-				this.server = null;
-			}
-		}
-	}
+            }
+            catch (Exception ex)
+            {
+                throw new TTransportException(ex.ToString());
+            }
+        }
+
+        /// <summary>
+        /// Stops the Server
+        /// </summary>
+        public override void Close()
+        {
+            if (this.server != null)
+            {
+                try
+                {
+                    this.server.Stop();
+                }
+                catch (Exception ex)
+                {
+                    throw new TTransportException("WARNING: Could not close server socket: " + ex);
+                }
+                this.server = null;
+            }
+        }
+    }
 }
diff --git a/lib/csharp/src/Transport/TTLSSocket.cs b/lib/csharp/src/Transport/TTLSSocket.cs
index b87576d..9e1f9f2 100644
--- a/lib/csharp/src/Transport/TTLSSocket.cs
+++ b/lib/csharp/src/Transport/TTLSSocket.cs
@@ -25,276 +25,276 @@
 
 namespace Thrift.Transport
 {
-	/// <summary>
-	/// SSL Socket Wrapper class
-	/// </summary>
-	public class TTLSSocket : TStreamTransport
-	{
-		/// <summary>
-		/// Internal TCP Client
-		/// </summary>
-		private TcpClient client = null;
+    /// <summary>
+    /// SSL Socket Wrapper class
+    /// </summary>
+    public class TTLSSocket : TStreamTransport
+    {
+        /// <summary>
+        /// Internal TCP Client
+        /// </summary>
+        private TcpClient client = null;
 
-		/// <summary>
-		/// The host
-		/// </summary>
-		private string host = null;
+        /// <summary>
+        /// The host
+        /// </summary>
+        private string host = null;
 
-		/// <summary>
-		/// The port
-		/// </summary>
-		private int port = 0;
+        /// <summary>
+        /// The port
+        /// </summary>
+        private int port = 0;
 
-		/// <summary>
-		/// The timeout for the connection
-		/// </summary>
-		private int timeout = 0;
+        /// <summary>
+        /// The timeout for the connection
+        /// </summary>
+        private int timeout = 0;
 
-		/// <summary>
-		/// Internal SSL Stream for IO
-		/// </summary>
-		private SslStream secureStream = null;
+        /// <summary>
+        /// Internal SSL Stream for IO
+        /// </summary>
+        private SslStream secureStream = null;
 
-		/// <summary>
-		/// Defines wheter or not this socket is a server socket<br/>
-		/// This is used for the TLS-authentication
-		/// </summary>
-		private bool isServer = false;
+        /// <summary>
+        /// Defines wheter or not this socket is a server socket<br/>
+        /// This is used for the TLS-authentication
+        /// </summary>
+        private bool isServer = false;
 
-		/// <summary>
-		/// The certificate
-		/// </summary>
-		private X509Certificate certificate = null;
+        /// <summary>
+        /// The certificate
+        /// </summary>
+        private X509Certificate certificate = null;
 
-		/// <summary>
-		/// User defined certificate validator.
-		/// </summary>
-		private RemoteCertificateValidationCallback certValidator = null;
+        /// <summary>
+        /// User defined certificate validator.
+        /// </summary>
+        private RemoteCertificateValidationCallback certValidator = null;
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="TTLSSocket"/> class.
-		/// </summary>
-		/// <param name="client">An already created TCP-client</param>
-		/// <param name="certificate">The certificate.</param>
-		/// <param name="isServer">if set to <c>true</c> [is server].</param>
-		public TTLSSocket(TcpClient client, X509Certificate certificate, bool isServer = false)
-		{
-			this.client = client;
-			this.certificate = certificate;
-			this.isServer = isServer;
+        /// <summary>
+        /// Initializes a new instance of the <see cref="TTLSSocket"/> class.
+        /// </summary>
+        /// <param name="client">An already created TCP-client</param>
+        /// <param name="certificate">The certificate.</param>
+        /// <param name="isServer">if set to <c>true</c> [is server].</param>
+        public TTLSSocket(TcpClient client, X509Certificate certificate, bool isServer = false)
+        {
+            this.client = client;
+            this.certificate = certificate;
+            this.isServer = isServer;
 
-			if (IsOpen)
-			{
-				base.inputStream = client.GetStream();
-				base.outputStream = client.GetStream();
-			}
-		}
+            if (IsOpen)
+            {
+                base.inputStream = client.GetStream();
+                base.outputStream = client.GetStream();
+            }
+        }
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="TTLSSocket"/> class.
-		/// </summary>
-		/// <param name="host">The host, where the socket should connect to.</param>
-		/// <param name="port">The port.</param>
-		/// <param name="certificatePath">The certificate path.</param>
-		/// <param name="certValidator">User defined cert validator.</param>
-		public TTLSSocket(string host, int port, string certificatePath, RemoteCertificateValidationCallback certValidator = null)
-			: this(host, port, 0, X509Certificate.CreateFromCertFile(certificatePath), certValidator)
-		{
-		}
+        /// <summary>
+        /// Initializes a new instance of the <see cref="TTLSSocket"/> class.
+        /// </summary>
+        /// <param name="host">The host, where the socket should connect to.</param>
+        /// <param name="port">The port.</param>
+        /// <param name="certificatePath">The certificate path.</param>
+        /// <param name="certValidator">User defined cert validator.</param>
+        public TTLSSocket(string host, int port, string certificatePath, RemoteCertificateValidationCallback certValidator = null)
+            : this(host, port, 0, X509Certificate.CreateFromCertFile(certificatePath), certValidator)
+        {
+        }
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="TTLSSocket"/> class.
-		/// </summary>
-		/// <param name="host">The host, where the socket should connect to.</param>
-		/// <param name="port">The port.</param>
-		/// <param name="certificate">The certificate.</param>
-		/// <param name="certValidator">User defined cert validator.</param>
-		public TTLSSocket(string host, int port, X509Certificate certificate, RemoteCertificateValidationCallback certValidator = null)
-			: this(host, port, 0, certificate, certValidator)
-		{
-		}
+        /// <summary>
+        /// Initializes a new instance of the <see cref="TTLSSocket"/> class.
+        /// </summary>
+        /// <param name="host">The host, where the socket should connect to.</param>
+        /// <param name="port">The port.</param>
+        /// <param name="certificate">The certificate.</param>
+        /// <param name="certValidator">User defined cert validator.</param>
+        public TTLSSocket(string host, int port, X509Certificate certificate, RemoteCertificateValidationCallback certValidator = null)
+            : this(host, port, 0, certificate, certValidator)
+        {
+        }
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="TTLSSocket"/> class.
-		/// </summary>
-		/// <param name="host">The host, where the socket should connect to.</param>
-		/// <param name="port">The port.</param>
-		/// <param name="timeout">The timeout.</param>
-		/// <param name="certificate">The certificate.</param>
-		/// <param name="certValidator">User defined cert validator.</param>
-		public TTLSSocket(string host, int port, int timeout, X509Certificate certificate, RemoteCertificateValidationCallback certValidator = null)
-		{
-			this.host = host;
-			this.port = port;
-			this.timeout = timeout;
-			this.certificate = certificate;
-			this.certValidator = certValidator;
+        /// <summary>
+        /// Initializes a new instance of the <see cref="TTLSSocket"/> class.
+        /// </summary>
+        /// <param name="host">The host, where the socket should connect to.</param>
+        /// <param name="port">The port.</param>
+        /// <param name="timeout">The timeout.</param>
+        /// <param name="certificate">The certificate.</param>
+        /// <param name="certValidator">User defined cert validator.</param>
+        public TTLSSocket(string host, int port, int timeout, X509Certificate certificate, RemoteCertificateValidationCallback certValidator = null)
+        {
+            this.host = host;
+            this.port = port;
+            this.timeout = timeout;
+            this.certificate = certificate;
+            this.certValidator = certValidator;
 
-			InitSocket();
-		}
+            InitSocket();
+        }
 
-		/// <summary>
-		/// Creates the TcpClient and sets the timeouts
-		/// </summary>
-		private void InitSocket()
-		{
-			this.client = new TcpClient();
-			client.ReceiveTimeout = client.SendTimeout = timeout;
-			client.Client.NoDelay = true;
-		}
+        /// <summary>
+        /// Creates the TcpClient and sets the timeouts
+        /// </summary>
+        private void InitSocket()
+        {
+            this.client = new TcpClient();
+            client.ReceiveTimeout = client.SendTimeout = timeout;
+            client.Client.NoDelay = true;
+        }
 
-		/// <summary>
-		/// Sets Send / Recv Timeout for IO
-		/// </summary>
-		public int Timeout
-		{
-			set
-			{
-				this.client.ReceiveTimeout = this.client.SendTimeout = this.timeout = value;
-			}
-		}
+        /// <summary>
+        /// Sets Send / Recv Timeout for IO
+        /// </summary>
+        public int Timeout
+        {
+            set
+            {
+                this.client.ReceiveTimeout = this.client.SendTimeout = this.timeout = value;
+            }
+        }
 
-		/// <summary>
-		/// Gets the TCP client.
-		/// </summary>
-		public TcpClient TcpClient
-		{
-			get
-			{
-				return client;
-			}
-		}
+        /// <summary>
+        /// Gets the TCP client.
+        /// </summary>
+        public TcpClient TcpClient
+        {
+            get
+            {
+                return client;
+            }
+        }
 
-		/// <summary>
-		/// Gets the host.
-		/// </summary>
-		public string Host
-		{
-			get
-			{
-				return host;
-			}
-		}
+        /// <summary>
+        /// Gets the host.
+        /// </summary>
+        public string Host
+        {
+            get
+            {
+                return host;
+            }
+        }
 
-		/// <summary>
-		/// Gets the port.
-		/// </summary>
-		public int Port
-		{
-			get
-			{
-				return port;
-			}
-		}
+        /// <summary>
+        /// Gets the port.
+        /// </summary>
+        public int Port
+        {
+            get
+            {
+                return port;
+            }
+        }
 
-		/// <summary>
-		/// Gets a value indicating whether TCP Client is Cpen 
-		/// </summary>
-		public override bool IsOpen
-		{
-			get
-			{
-				if (this.client == null)
-				{
-					return false;
-				}
+        /// <summary>
+        /// Gets a value indicating whether TCP Client is Cpen
+        /// </summary>
+        public override bool IsOpen
+        {
+            get
+            {
+                if (this.client == null)
+                {
+                    return false;
+                }
 
-				return this.client.Connected;
-			}
-		}
+                return this.client.Connected;
+            }
+        }
 
-		/// <summary>
-		/// Validates the certificates!<br/>
-		/// </summary>
-		/// <param name="sender">The sender-object.</param>
-		/// <param name="certificate">The used certificate.</param>
-		/// <param name="chain">The certificate chain.</param>
-		/// <param name="sslPolicyErrors">An enum, which lists all the errors from the .NET certificate check.</param>
-		/// <returns></returns>
-		private bool CertificateValidator(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslValidationErrors)
-		{
-			return (sslValidationErrors == SslPolicyErrors.None);
-		}
+        /// <summary>
+        /// Validates the certificates!<br/>
+        /// </summary>
+        /// <param name="sender">The sender-object.</param>
+        /// <param name="certificate">The used certificate.</param>
+        /// <param name="chain">The certificate chain.</param>
+        /// <param name="sslPolicyErrors">An enum, which lists all the errors from the .NET certificate check.</param>
+        /// <returns></returns>
+        private bool CertificateValidator(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslValidationErrors)
+        {
+            return (sslValidationErrors == SslPolicyErrors.None);
+        }
 
-		/// <summary>
-		/// Connects to the host and starts the routine, which sets up the TLS
-		/// </summary>
-		public override void Open()
-		{
-			if (IsOpen)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.AlreadyOpen, "Socket already connected");
-			}
+        /// <summary>
+        /// Connects to the host and starts the routine, which sets up the TLS
+        /// </summary>
+        public override void Open()
+        {
+            if (IsOpen)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.AlreadyOpen, "Socket already connected");
+            }
 
-			if (String.IsNullOrEmpty(host))
-			{
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot open null host");
-			}
+            if (String.IsNullOrEmpty(host))
+            {
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot open null host");
+            }
 
-			if (port <= 0)
-			{
-				throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot open without port");
-			}
+            if (port <= 0)
+            {
+                throw new TTransportException(TTransportException.ExceptionType.NotOpen, "Cannot open without port");
+            }
 
-			if (client == null)
-			{
-				InitSocket();
-			}
+            if (client == null)
+            {
+                InitSocket();
+            }
 
-			client.Connect(host, port);
+            client.Connect(host, port);
 
-			setupTLS();
-		}
+            setupTLS();
+        }
 
-		/// <summary>
-		/// Creates a TLS-stream and lays it over the existing socket
-		/// </summary>
-		public void setupTLS()
-		{
-			if (isServer)
-			{
-				// Server authentication
-				this.secureStream = new SslStream(this.client.GetStream(), false);
-				this.secureStream.AuthenticateAsServer(this.certificate, false, SslProtocols.Tls, true);
-			}
-			else
-			{
-				// Client authentication
-				X509CertificateCollection validCerts = new X509CertificateCollection();
-				validCerts.Add(certificate);
+        /// <summary>
+        /// Creates a TLS-stream and lays it over the existing socket
+        /// </summary>
+        public void setupTLS()
+        {
+            if (isServer)
+            {
+                // Server authentication
+                this.secureStream = new SslStream(this.client.GetStream(), false);
+                this.secureStream.AuthenticateAsServer(this.certificate, false, SslProtocols.Tls, true);
+            }
+            else
+            {
+                // Client authentication
+                X509CertificateCollection validCerts = new X509CertificateCollection();
+                validCerts.Add(certificate);
 
-				if (this.certValidator != null)
-				{
-					this.secureStream = new SslStream(this.client.GetStream(), false, new RemoteCertificateValidationCallback(this.certValidator));
-				}
-				else
-				{
-					this.secureStream = new SslStream(this.client.GetStream(), false, new RemoteCertificateValidationCallback(CertificateValidator));
-				}
-				this.secureStream.AuthenticateAsClient(host, validCerts, SslProtocols.Tls, true);
-			}
+                if (this.certValidator != null)
+                {
+                    this.secureStream = new SslStream(this.client.GetStream(), false, new RemoteCertificateValidationCallback(this.certValidator));
+                }
+                else
+                {
+                    this.secureStream = new SslStream(this.client.GetStream(), false, new RemoteCertificateValidationCallback(CertificateValidator));
+                }
+                this.secureStream.AuthenticateAsClient(host, validCerts, SslProtocols.Tls, true);
+            }
 
-			inputStream = this.secureStream;
-			outputStream = this.secureStream;
-		}
+            inputStream = this.secureStream;
+            outputStream = this.secureStream;
+        }
 
-		/// <summary>
-		/// Closes the SSL Socket
-		/// </summary>
-		public override void Close()
-		{
-			base.Close();
-			if (this.client != null)
-			{
-				this.client.Close();
-				this.client = null;
-			}
+        /// <summary>
+        /// Closes the SSL Socket
+        /// </summary>
+        public override void Close()
+        {
+            base.Close();
+            if (this.client != null)
+            {
+                this.client.Close();
+                this.client = null;
+            }
 
-			if (this.secureStream != null)
-			{
-				this.secureStream.Close();
-				this.secureStream = null;
-			}
-		}
-	}
+            if (this.secureStream != null)
+            {
+                this.secureStream.Close();
+                this.secureStream = null;
+            }
+        }
+    }
 }
diff --git a/lib/csharp/src/Transport/TTransport.cs b/lib/csharp/src/Transport/TTransport.cs
index 5bb8f9e..13314ec 100644
--- a/lib/csharp/src/Transport/TTransport.cs
+++ b/lib/csharp/src/Transport/TTransport.cs
@@ -25,24 +25,24 @@
 
 namespace Thrift.Transport
 {
-	public abstract class TTransport : IDisposable
-	{
-		public abstract bool IsOpen
-		{
-			get;
-		}
+    public abstract class TTransport : IDisposable
+    {
+        public abstract bool IsOpen
+        {
+            get;
+        }
 
-		private byte[] _peekBuffer = new byte[1];
+        private byte[] _peekBuffer = new byte[1];
         private bool _hasPeekByte = false;
 
         public bool Peek()
         {
             //If we already have a byte read but not consumed, do nothing.
-            if (_hasPeekByte) 
+            if (_hasPeekByte)
                 return true;
 
             //If transport closed we can't peek.
-            if (!IsOpen) 
+            if (!IsOpen)
                 return false;
 
             //Try to read one byte. If succeeds we will need to store it for the next read.
@@ -54,15 +54,15 @@
             return true;
         }
 
-		public abstract void Open();
+        public abstract void Open();
 
-		public abstract void Close();
+        public abstract void Close();
 
-		public abstract int Read(byte[] buf, int off, int len);
+        public abstract int Read(byte[] buf, int off, int len);
 
-		public int ReadAll(byte[] buf, int off, int len)
-		{
-			int got = 0;
+        public int ReadAll(byte[] buf, int off, int len)
+        {
+            int got = 0;
 
             //If we previously peeked a byte, we need to use that first.
             if (_hasPeekByte)
@@ -83,19 +83,19 @@
                 got += ret;
             }
             return got;
-		}
+        }
 
-		public virtual void Write(byte[] buf) 
-		{
-			Write (buf, 0, buf.Length);
-		}
+        public virtual void Write(byte[] buf)
+        {
+            Write (buf, 0, buf.Length);
+        }
 
-		public abstract void Write(byte[] buf, int off, int len);
+        public abstract void Write(byte[] buf, int off, int len);
 
-		public virtual void Flush()
-		{
-		}
-        
+        public virtual void Flush()
+        {
+        }
+
         public virtual IAsyncResult BeginFlush(AsyncCallback callback, object state)
         {
             throw new TTransportException(
@@ -110,16 +110,16 @@
                 "Asynchronous operations are not supported by this transport.");
         }
 
-		#region " IDisposable Support "
-		// IDisposable
-		protected abstract void Dispose(bool disposing);
+        #region " IDisposable Support "
+        // IDisposable
+        protected abstract void Dispose(bool disposing);
 
-		public void Dispose()
-		{
-			// Do not change this code.  Put cleanup code in Dispose(ByVal disposing As Boolean) above.
-			Dispose(true);
-			GC.SuppressFinalize(this);
-		}
-		#endregion
-	}
+        public void Dispose()
+        {
+            // Do not change this code.  Put cleanup code in Dispose(ByVal disposing As Boolean) above.
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+        #endregion
+    }
 }
diff --git a/lib/csharp/src/Transport/TTransportException.cs b/lib/csharp/src/Transport/TTransportException.cs
index fda0138..6dcd987 100644
--- a/lib/csharp/src/Transport/TTransportException.cs
+++ b/lib/csharp/src/Transport/TTransportException.cs
@@ -25,44 +25,44 @@
 
 namespace Thrift.Transport
 {
-	public class TTransportException : TException
-	{
-		protected ExceptionType type;
+    public class TTransportException : TException
+    {
+        protected ExceptionType type;
 
-		public TTransportException()
-			: base()
-		{
-		}
+        public TTransportException()
+            : base()
+        {
+        }
 
-		public TTransportException(ExceptionType type)
-			: this()
-		{
-			this.type = type;
-		}
+        public TTransportException(ExceptionType type)
+            : this()
+        {
+            this.type = type;
+        }
 
-		public TTransportException(ExceptionType type, string message)
-			: base(message)
-		{
-			this.type = type;
-		}
+        public TTransportException(ExceptionType type, string message)
+            : base(message)
+        {
+            this.type = type;
+        }
 
-		public TTransportException(string message)
-			: base(message)
-		{
-		}
+        public TTransportException(string message)
+            : base(message)
+        {
+        }
 
-		public ExceptionType Type
-		{
-			get { return type; }
-		}
+        public ExceptionType Type
+        {
+            get { return type; }
+        }
 
-		public enum ExceptionType
-		{
-			Unknown,
-			NotOpen,
-			AlreadyOpen,
-			TimedOut,
-			EndOfFile
-		}
-	}
+        public enum ExceptionType
+        {
+            Unknown,
+            NotOpen,
+            AlreadyOpen,
+            TimedOut,
+            EndOfFile
+        }
+    }
 }
diff --git a/lib/csharp/src/Transport/TTransportFactory.cs b/lib/csharp/src/Transport/TTransportFactory.cs
index 8f4f15d..fa10033 100644
--- a/lib/csharp/src/Transport/TTransportFactory.cs
+++ b/lib/csharp/src/Transport/TTransportFactory.cs
@@ -25,18 +25,18 @@
 
 namespace Thrift.Transport
 {
-	/// <summary>
-	/// From Mark Slee & Aditya Agarwal of Facebook:
-	/// Factory class used to create wrapped instance of Transports.
-	/// This is used primarily in servers, which get Transports from
-	/// a ServerTransport and then may want to mutate them (i.e. create
-	/// a BufferedTransport from the underlying base transport)
-	/// </summary>
-	public class TTransportFactory
-	{
-		public virtual TTransport GetTransport(TTransport trans)
-		{
-			return trans;
-		}
-	}
+    /// <summary>
+    /// From Mark Slee & Aditya Agarwal of Facebook:
+    /// Factory class used to create wrapped instance of Transports.
+    /// This is used primarily in servers, which get Transports from
+    /// a ServerTransport and then may want to mutate them (i.e. create
+    /// a BufferedTransport from the underlying base transport)
+    /// </summary>
+    public class TTransportFactory
+    {
+        public virtual TTransport GetTransport(TTransport trans)
+        {
+            return trans;
+        }
+    }
 }