You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2009/02/13 04:09:54 UTC
svn commit: r743963 - in /incubator/thrift/trunk: ./
compiler/cpp/src/generate/ lib/csharp/ lib/csharp/src/
lib/csharp/src/Collections/ lib/csharp/src/Protocol/ lib/csharp/src/Server/
lib/csharp/src/Transport/ test/csharp/ test/csharp/ThriftTest/
Author: dreiss
Date: Fri Feb 13 03:09:52 2009
New Revision: 743963
URL: http://svn.apache.org/viewvc?rev=743963&view=rev
Log:
THRIFT-309. Make Thrift's C# mapping .NET 2.0 (Mono 1.2.4) compatible
Added:
incubator/thrift/trunk/lib/csharp/src/Collections/
incubator/thrift/trunk/lib/csharp/src/Collections/THashSet.cs
incubator/thrift/trunk/test/csharp/ThriftTest/maketest.sh (with props)
Modified:
incubator/thrift/trunk/compiler/cpp/src/generate/t_csharp_generator.cc
incubator/thrift/trunk/configure.ac
incubator/thrift/trunk/lib/csharp/Makefile.am
incubator/thrift/trunk/lib/csharp/src/Protocol/TBinaryProtocol.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TField.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TList.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TMap.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TMessage.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TMessageType.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocol.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolException.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolFactory.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolUtil.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TSet.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TStruct.cs
incubator/thrift/trunk/lib/csharp/src/Protocol/TType.cs
incubator/thrift/trunk/lib/csharp/src/Server/TServer.cs
incubator/thrift/trunk/lib/csharp/src/Server/TSimpleServer.cs
incubator/thrift/trunk/lib/csharp/src/Server/TThreadPoolServer.cs
incubator/thrift/trunk/lib/csharp/src/Server/TThreadedServer.cs
incubator/thrift/trunk/lib/csharp/src/TApplicationException.cs
incubator/thrift/trunk/lib/csharp/src/TProcessor.cs
incubator/thrift/trunk/lib/csharp/src/Thrift.csproj
incubator/thrift/trunk/lib/csharp/src/Transport/TBufferedTransport.cs
incubator/thrift/trunk/lib/csharp/src/Transport/TServerSocket.cs
incubator/thrift/trunk/lib/csharp/src/Transport/TServerTransport.cs
incubator/thrift/trunk/lib/csharp/src/Transport/TSocket.cs
incubator/thrift/trunk/lib/csharp/src/Transport/TStreamTransport.cs
incubator/thrift/trunk/lib/csharp/src/Transport/TTransport.cs
incubator/thrift/trunk/lib/csharp/src/Transport/TTransportException.cs
incubator/thrift/trunk/lib/csharp/src/Transport/TTransportFactory.cs
incubator/thrift/trunk/test/csharp/CSharpServer.cs
incubator/thrift/trunk/test/csharp/ThriftTest/Program.cs
incubator/thrift/trunk/test/csharp/ThriftTest/TestClient.cs
incubator/thrift/trunk/test/csharp/ThriftTest/TestServer.cs
incubator/thrift/trunk/test/csharp/ThriftTest/ThriftTest.csproj
Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_csharp_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_csharp_generator.cc?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_csharp_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_csharp_generator.cc Fri Feb 13 03:09:52 2009
@@ -145,7 +145,8 @@
"using System.Collections.Generic;\n" +
"using System.Text;\n" +
"using System.IO;\n" +
- "using Thrift;\n";
+ "using Thrift;\n" +
+ "using Thrift.Collections;\n";
}
string t_csharp_generator::csharp_thrift_usings() {
@@ -1534,7 +1535,7 @@
", " + type_name(tmap->get_val_type(), true) + ">";
} else if (ttype->is_set()) {
t_set* tset = (t_set*) ttype;
- return "HashSet<" + type_name(tset->get_elem_type(), true) + ">";
+ return "THashSet<" + type_name(tset->get_elem_type(), true) + ">";
} else if (ttype->is_list()) {
t_list* tlist = (t_list*) ttype;
return "List<" + type_name(tlist->get_elem_type(), true) + ">";
Modified: incubator/thrift/trunk/configure.ac
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/configure.ac?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/configure.ac (original)
+++ incubator/thrift/trunk/configure.ac Fri Feb 13 03:09:52 2009
@@ -41,9 +41,11 @@
AX_THRIFT_LIB(csharp, [C#], yes)
if test "$with_csharp" = "yes"; then
- PKG_CHECK_MODULES(MONO, mono >= 1.2.6, have_mono=yes, have_mono=no)
+ PKG_CHECK_MODULES(MONO, mono >= 2.0.0, net_3_5=yes, net_3_5=no)
+ PKG_CHECK_MODULES(MONO, mono >= 1.2.4, have_mono=yes, have_mono=no)
fi
AM_CONDITIONAL(WITH_MONO, [test "$have_mono" = "yes"])
+AM_CONDITIONAL(NET_2_0, [test "$net_3_5" = "no"])
AX_THRIFT_LIB(java, [Java], yes)
if test "$with_java" = "yes"; then
Modified: incubator/thrift/trunk/lib/csharp/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/Makefile.am?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/Makefile.am (original)
+++ incubator/thrift/trunk/lib/csharp/Makefile.am Fri Feb 13 03:09:52 2009
@@ -1,4 +1,5 @@
THRIFTCODE= \
+ src/Collections/THashSet.cs \
src/Protocol/TBase.cs \
src/Protocol/TProtocolException.cs \
src/Protocol/TProtocolFactory.cs \
@@ -31,10 +32,14 @@
CSC=gmcs
+if NET_2_0
+MONO_DEFINES=/d:NET_2_0
+endif
+
all-local: Thrift.dll
Thrift.dll: $(THRIFTCODE)
- $(CSC) $(THRIFTCODE) /out:Thrift.dll /target:library /langversion:linq
+ $(CSC) $(THRIFTCODE) /out:Thrift.dll /target:library $(MONO_DEFINES)
clean-local:
$(RM) Thrift.dll
Added: incubator/thrift/trunk/lib/csharp/src/Collections/THashSet.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Collections/THashSet.cs?rev=743963&view=auto
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Collections/THashSet.cs (added)
+++ incubator/thrift/trunk/lib/csharp/src/Collections/THashSet.cs Fri Feb 13 03:09:52 2009
@@ -0,0 +1,142 @@
+/**
+ * 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.Collections;
+using System.Collections.Generic;
+
+namespace Thrift.Collections
+{
+ public class THashSet<T> : ICollection<T>
+ {
+#if NET_2_0
+ TDictSet<T> set = new TDictSet<T>();
+#else
+ HashSet<T> set = new HashSet<T>();
+#endif
+ public int Count
+ {
+ get { return set.Count; }
+ }
+
+ public bool IsReadOnly
+ {
+ get { return set.IsReadOnly; }
+ }
+
+ public void Add(T item)
+ {
+ set.Add(item);
+ }
+
+ public void Clear()
+ {
+ set.Clear();
+ }
+
+ public bool Contains(T item)
+ {
+ return set.Contains(item);
+ }
+
+ public void CopyTo(T[] array, int arrayIndex)
+ {
+ set.CopyTo(array, arrayIndex);
+ }
+
+ public IEnumerator GetEnumerator()
+ {
+ return set.GetEnumerator();
+ }
+
+ IEnumerator<T> IEnumerable<T>.GetEnumerator()
+ {
+ return ((IEnumerable<T>)set).GetEnumerator();
+ }
+
+ public bool Remove(T item)
+ {
+ return set.Remove(item);
+ }
+
+#if NET_2_0
+ private class TDictSet<V> : ICollection<V>
+ {
+ Dictionary<V, TDictSet<V>> dict = new Dictionary<V, TDictSet<V>>();
+
+ public int Count
+ {
+ get { return dict.Count; }
+ }
+
+ public bool IsReadOnly
+ {
+ get { return false; }
+ }
+
+ public IEnumerator GetEnumerator()
+ {
+ return ((IEnumerable)dict.Keys).GetEnumerator();
+ }
+
+ IEnumerator<V> IEnumerable<V>.GetEnumerator()
+ {
+ return dict.Keys.GetEnumerator();
+ }
+
+ public bool Add(V item)
+ {
+ if (!dict.ContainsKey(item))
+ {
+ dict[item] = this;
+ return true;
+ }
+
+ return false;
+ }
+
+ void ICollection<V>.Add(V item)
+ {
+ Add(item);
+ }
+
+ public void Clear()
+ {
+ dict.Clear();
+ }
+
+ public bool Contains(V item)
+ {
+ return dict.ContainsKey(item);
+ }
+
+ public void CopyTo(V[] array, int arrayIndex)
+ {
+ dict.Keys.CopyTo(array, arrayIndex);
+ }
+
+ public bool Remove(V item)
+ {
+ return dict.Remove(item);
+ }
+ }
+#endif
+ }
+
+}
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TBinaryProtocol.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TBinaryProtocol.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TBinaryProtocol.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TBinaryProtocol.cs Fri Feb 13 03:09:52 2009
@@ -12,7 +12,6 @@
// http://developers.facebook.com/thrift/using
using System;
-using System.Collections.Generic;
using System.Text;
using Thrift.Transport;
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TField.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TField.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TField.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TField.cs Fri Feb 13 03:09:52 2009
@@ -18,30 +18,34 @@
{
public struct TField
{
+ private string name;
+ private TType type;
+ private short id;
+
public TField(string name, TType type, short id)
:this()
{
- Name = name;
- Type = type;
- ID = id;
+ this.name = name;
+ this.type = type;
+ this.id = id;
}
public string Name
{
- get;
- set;
+ get { return name; }
+ set { name = value; }
}
public TType Type
{
- get;
- set;
+ get { return type; }
+ set { type = value; }
}
public short ID
{
- get;
- set;
+ get { return id; }
+ set { id = value; }
}
}
}
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TList.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TList.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TList.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TList.cs Fri Feb 13 03:09:52 2009
@@ -18,23 +18,26 @@
{
public struct TList
{
+ private TType elementType;
+ private int count;
+
public TList(TType elementType, int count)
:this()
{
- ElementType = elementType;
- Count = count;
+ this.elementType = elementType;
+ this.count = count;
}
public TType ElementType
{
- get;
- set;
+ get { return elementType; }
+ set { elementType = value; }
}
public int Count
{
- get;
- set;
+ get { return count; }
+ set { count = value; }
}
}
}
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TMap.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TMap.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TMap.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TMap.cs Fri Feb 13 03:09:52 2009
@@ -18,30 +18,34 @@
{
public struct TMap
{
+ private TType keyType;
+ private TType valueType;
+ private int count;
+
public TMap(TType keyType, TType valueType, int count)
:this()
{
- KeyType = keyType;
- ValueType = valueType;
- Count = count;
+ this.keyType = keyType;
+ this.valueType = valueType;
+ this.count = count;
}
public TType KeyType
{
- get;
- set;
+ get { return keyType; }
+ set { keyType = value; }
}
public TType ValueType
{
- get;
- set;
+ get { return valueType; }
+ set { valueType = value; }
}
public int Count
{
- get;
- set;
+ get { return count; }
+ set { count = value; }
}
}
}
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TMessage.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TMessage.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TMessage.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TMessage.cs Fri Feb 13 03:09:52 2009
@@ -18,30 +18,34 @@
{
public struct TMessage
{
+ private string name;
+ private TMessageType type;
+ private int seqID;
+
public TMessage(string name, TMessageType type, int seqid)
:this()
{
- Name = name;
- Type = type;
- SeqID = seqid;
+ this.name = name;
+ this.type = type;
+ this.seqID = seqid;
}
public string Name
{
- get;
- set;
+ get { return name; }
+ set { name = value; }
}
public TMessageType Type
{
- get;
- set;
+ get { return type; }
+ set { type = value; }
}
public int SeqID
{
- get;
- set;
+ get { return seqID; }
+ set { seqID = value; }
}
}
}
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TMessageType.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TMessageType.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TMessageType.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TMessageType.cs Fri Feb 13 03:09:52 2009
@@ -11,8 +11,6 @@
// http://developers.facebook.com/thrift/using
using System;
-using System.Collections.Generic;
-using System.Text;
namespace Thrift.Protocol
{
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocol.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocol.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocol.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocol.cs Fri Feb 13 03:09:52 2009
@@ -11,7 +11,6 @@
// http://developers.facebook.com/thrift/using
using System;
-using System.Collections.Generic;
using System.Text;
using Thrift.Transport;
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolException.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolException.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolException.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolException.cs Fri Feb 13 03:09:52 2009
@@ -1,6 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Text;
namespace Thrift.Protocol
{
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolFactory.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolFactory.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolFactory.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolFactory.cs Fri Feb 13 03:09:52 2009
@@ -10,8 +10,6 @@
// See accompanying file LICENSE or visit the Thrift site at:
// http://developers.facebook.com/thrift/using
using System;
-using System.Collections.Generic;
-using System.Text;
using Thrift.Transport;
namespace Thrift.Protocol
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolUtil.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolUtil.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolUtil.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TProtocolUtil.cs Fri Feb 13 03:09:52 2009
@@ -11,8 +11,6 @@
// http://developers.facebook.com/thrift/using
using System;
-using System.Collections.Generic;
-using System.Text;
namespace Thrift.Protocol
{
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TSet.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TSet.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TSet.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TSet.cs Fri Feb 13 03:09:52 2009
@@ -18,23 +18,26 @@
{
public struct TSet
{
+ private TType elementType;
+ private int count;
+
public TSet(TType elementType, int count)
:this()
{
- ElementType = elementType;
- Count = count;
+ this.elementType = elementType;
+ this.count = count;
}
public TType ElementType
{
- get;
- set;
+ get { return elementType; }
+ set { elementType = value; }
}
public int Count
{
- get;
- set;
+ get { return count; }
+ set { count = value; }
}
}
}
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TStruct.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TStruct.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TStruct.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TStruct.cs Fri Feb 13 03:09:52 2009
@@ -17,16 +17,18 @@
{
public struct TStruct
{
+ private string name;
+
public TStruct(string name)
:this()
{
- Name = name;
+ this.name = name;
}
public string Name
{
- get;
- set;
+ get { return name; }
+ set { name = value; }
}
}
}
Modified: incubator/thrift/trunk/lib/csharp/src/Protocol/TType.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Protocol/TType.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Protocol/TType.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Protocol/TType.cs Fri Feb 13 03:09:52 2009
@@ -11,8 +11,6 @@
// http://developers.facebook.com/thrift/using
using System;
-using System.Collections.Generic;
-using System.Text;
namespace Thrift.Protocol
{
Modified: incubator/thrift/trunk/lib/csharp/src/Server/TServer.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Server/TServer.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Server/TServer.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Server/TServer.cs Fri Feb 13 03:09:52 2009
@@ -11,7 +11,6 @@
// http://developers.facebook.com/thrift/using
using System;
-using System.Collections.Generic;
using Thrift.Protocol;
using Thrift.Transport;
using System.IO;
Modified: incubator/thrift/trunk/lib/csharp/src/Server/TSimpleServer.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Server/TSimpleServer.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Server/TSimpleServer.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Server/TSimpleServer.cs Fri Feb 13 03:09:52 2009
@@ -10,8 +10,6 @@
// See accompanying file LICENSE or visit the Thrift site at:
// http://developers.facebook.com/thrift/using
using System;
-using System.Collections.Generic;
-using System.Text;
using Thrift.Transport;
using Thrift.Protocol;
Modified: incubator/thrift/trunk/lib/csharp/src/Server/TThreadPoolServer.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Server/TThreadPoolServer.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Server/TThreadPoolServer.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Server/TThreadPoolServer.cs Fri Feb 13 03:09:52 2009
@@ -10,8 +10,6 @@
// See accompanying file LICENSE or visit the Thrift site at:
// http://developers.facebook.com/thrift/using
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Threading;
using Thrift.Protocol;
using Thrift.Transport;
Modified: incubator/thrift/trunk/lib/csharp/src/Server/TThreadedServer.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Server/TThreadedServer.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Server/TThreadedServer.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Server/TThreadedServer.cs Fri Feb 13 03:09:52 2009
@@ -11,8 +11,8 @@
// http://developers.facebook.com/thrift/using
using System;
using System.Collections.Generic;
-using System.Text;
using System.Threading;
+using Thrift.Collections;
using Thrift.Protocol;
using Thrift.Transport;
@@ -28,7 +28,7 @@
private readonly int maxThreads;
private Queue<TTransport> clientQueue;
- private HashSet<Thread> clientThreads;
+ private THashSet<Thread> clientThreads;
private object clientLock;
private Thread workerThread;
@@ -73,7 +73,7 @@
this.maxThreads = maxThreads;
clientQueue = new Queue<TTransport>();
clientLock = new object();
- clientThreads = new HashSet<Thread>();
+ clientThreads = new THashSet<Thread>();
}
/// <summary>
Modified: incubator/thrift/trunk/lib/csharp/src/TApplicationException.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/TApplicationException.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/TApplicationException.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/TApplicationException.cs Fri Feb 13 03:09:52 2009
@@ -11,8 +11,6 @@
// http://developers.facebook.com/thrift/using
using System;
-using System.Collections.Generic;
-using System.Text;
using Thrift.Protocol;
namespace Thrift
Modified: incubator/thrift/trunk/lib/csharp/src/TProcessor.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/TProcessor.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/TProcessor.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/TProcessor.cs Fri Feb 13 03:09:52 2009
@@ -11,8 +11,6 @@
// http://developers.facebook.com/thrift/using
using System;
-using System.Collections.Generic;
-using System.Text;
using Thrift.Protocol;
namespace Thrift
Modified: incubator/thrift/trunk/lib/csharp/src/Thrift.csproj
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Thrift.csproj?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Thrift.csproj (original)
+++ incubator/thrift/trunk/lib/csharp/src/Thrift.csproj Fri Feb 13 03:09:52 2009
@@ -38,14 +38,9 @@
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Collections\THashSet.cs" />
<Compile Include="Protocol\TBase.cs" />
<Compile Include="Protocol\TBinaryProtocol.cs" />
<Compile Include="Protocol\TField.cs" />
Modified: incubator/thrift/trunk/lib/csharp/src/Transport/TBufferedTransport.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Transport/TBufferedTransport.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Transport/TBufferedTransport.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Transport/TBufferedTransport.cs Fri Feb 13 03:09:52 2009
@@ -7,9 +7,6 @@
//
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.IO;
namespace Thrift.Transport
Modified: incubator/thrift/trunk/lib/csharp/src/Transport/TServerSocket.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Transport/TServerSocket.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Transport/TServerSocket.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Transport/TServerSocket.cs Fri Feb 13 03:09:52 2009
@@ -9,8 +9,6 @@
// All rights reserved.
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Net.Sockets;
Modified: incubator/thrift/trunk/lib/csharp/src/Transport/TServerTransport.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Transport/TServerTransport.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Transport/TServerTransport.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Transport/TServerTransport.cs Fri Feb 13 03:09:52 2009
@@ -8,8 +8,6 @@
// Copyright (C) 2007 imeem, inc. <http://www.imeem.com>
// All rights reserved.
using System;
-using System.Collections.Generic;
-using System.Text;
namespace Thrift.Transport
{
Modified: incubator/thrift/trunk/lib/csharp/src/Transport/TSocket.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Transport/TSocket.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Transport/TSocket.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Transport/TSocket.cs Fri Feb 13 03:09:52 2009
@@ -10,8 +10,6 @@
//
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Net.Sockets;
namespace Thrift.Transport
Modified: incubator/thrift/trunk/lib/csharp/src/Transport/TStreamTransport.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Transport/TStreamTransport.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Transport/TStreamTransport.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Transport/TStreamTransport.cs Fri Feb 13 03:09:52 2009
@@ -10,8 +10,6 @@
//
using System;
-using System.Collections.Generic;
-using System.Text;
using System.IO;
namespace Thrift.Transport
Modified: incubator/thrift/trunk/lib/csharp/src/Transport/TTransport.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Transport/TTransport.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Transport/TTransport.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Transport/TTransport.cs Fri Feb 13 03:09:52 2009
@@ -10,8 +10,6 @@
//
using System;
-using System.Collections.Generic;
-using System.Text;
namespace Thrift.Transport
{
Modified: incubator/thrift/trunk/lib/csharp/src/Transport/TTransportException.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Transport/TTransportException.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Transport/TTransportException.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Transport/TTransportException.cs Fri Feb 13 03:09:52 2009
@@ -10,8 +10,6 @@
//
using System;
-using System.Collections.Generic;
-using System.Text;
namespace Thrift.Transport
{
Modified: incubator/thrift/trunk/lib/csharp/src/Transport/TTransportFactory.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/csharp/src/Transport/TTransportFactory.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/csharp/src/Transport/TTransportFactory.cs (original)
+++ incubator/thrift/trunk/lib/csharp/src/Transport/TTransportFactory.cs Fri Feb 13 03:09:52 2009
@@ -9,9 +9,6 @@
// All rights reserved.
//
using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace Thrift.Transport
{
Modified: incubator/thrift/trunk/test/csharp/CSharpServer.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/test/csharp/CSharpServer.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/test/csharp/CSharpServer.cs (original)
+++ incubator/thrift/trunk/test/csharp/CSharpServer.cs Fri Feb 13 03:09:52 2009
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using Thrift.Server;
using Thrift.Transport;
Modified: incubator/thrift/trunk/test/csharp/ThriftTest/Program.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/test/csharp/ThriftTest/Program.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/test/csharp/ThriftTest/Program.cs (original)
+++ incubator/thrift/trunk/test/csharp/ThriftTest/Program.cs Fri Feb 13 03:09:52 2009
@@ -4,8 +4,6 @@
// http://developers.facebook.com/thrift/
using System;
-using System.Collections.Generic;
-using System.Text;
using Thrift.Transport;
using Thrift.Protocol;
using Thrift.Test; //generated code
Modified: incubator/thrift/trunk/test/csharp/ThriftTest/TestClient.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/test/csharp/ThriftTest/TestClient.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/test/csharp/ThriftTest/TestClient.cs (original)
+++ incubator/thrift/trunk/test/csharp/ThriftTest/TestClient.cs Fri Feb 13 03:09:52 2009
@@ -1,11 +1,10 @@
using System;
using System.Collections.Generic;
-using System.Text;
-
+using System.Threading;
+using Thrift.Collections;
using Thrift.Protocol;
using Thrift.Transport;
using Thrift.Test;
-using System.Threading;
namespace Test
{
@@ -247,7 +246,7 @@
Console.WriteLine("}");
//set
- HashSet<int> setout = new HashSet<int>();
+ THashSet<int> setout = new THashSet<int>();
for (int j = -2; j < 3; j++)
{
setout.Add(j);
@@ -268,7 +267,7 @@
}
Console.Write("})");
- HashSet<int> setin = client.testSet(setout);
+ THashSet<int> setin = client.testSet(setout);
Console.Write(" = {");
first = true;
Modified: incubator/thrift/trunk/test/csharp/ThriftTest/TestServer.cs
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/test/csharp/ThriftTest/TestServer.cs?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/test/csharp/ThriftTest/TestServer.cs (original)
+++ incubator/thrift/trunk/test/csharp/ThriftTest/TestServer.cs Fri Feb 13 03:09:52 2009
@@ -4,9 +4,8 @@
// http://developers.facebook.com/thrift/
using System;
using System.Collections.Generic;
-using System.Text;
+using Thrift.Collections;
using Thrift.Test; //generated code
-
using Thrift.Transport;
using Thrift.Protocol;
using Thrift.Server;
@@ -99,7 +98,7 @@
return thing;
}
- public HashSet<int> testSet(HashSet<int> thing)
+ public THashSet<int> testSet(THashSet<int> thing)
{
Console.WriteLine("testSet({");
bool first = true;
@@ -305,10 +304,13 @@
TServer serverEngine;
// Simple Server
- // serverEngine = new TSimpleServer(testProcessor, tServerSocket);
+ serverEngine = new TSimpleServer(testProcessor, tServerSocket);
// ThreadPool Server
- serverEngine = new TThreadPoolServer(testProcessor, tServerSocket);
+ // serverEngine = new TThreadPoolServer(testProcessor, tServerSocket);
+
+ // Threaded Server
+ // serverEngine = new TThreadedServer(testProcessor, tServerSocket);
testHandler.server = serverEngine;
Modified: incubator/thrift/trunk/test/csharp/ThriftTest/ThriftTest.csproj
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/test/csharp/ThriftTest/ThriftTest.csproj?rev=743963&r1=743962&r2=743963&view=diff
==============================================================================
--- incubator/thrift/trunk/test/csharp/ThriftTest/ThriftTest.csproj (original)
+++ incubator/thrift/trunk/test/csharp/ThriftTest/ThriftTest.csproj Fri Feb 13 03:09:52 2009
@@ -51,17 +51,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Xml.Linq">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data.DataSetExtensions">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
<Reference Include="ThriftImpl, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\ThriftImpl.dll</HintPath>
@@ -117,6 +106,6 @@
cd $(ProjectDir)
-C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /t:library /out:.\ThriftImpl.dll /recurse:.\gen-csharp\* /reference:$(ProjectDir)..\..\..\lib\csharp\src\bin\Debug\Thrift.dll</PreBuildEvent>
+$(MSBuildToolsPath)\Csc.exe /t:library /out:.\ThriftImpl.dll /recurse:.\gen-csharp\* /reference:$(ProjectDir)..\..\..\lib\csharp\src\bin\Debug\Thrift.dll</PreBuildEvent>
</PropertyGroup>
</Project>
Added: incubator/thrift/trunk/test/csharp/ThriftTest/maketest.sh
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/test/csharp/ThriftTest/maketest.sh?rev=743963&view=auto
==============================================================================
--- incubator/thrift/trunk/test/csharp/ThriftTest/maketest.sh (added)
+++ incubator/thrift/trunk/test/csharp/ThriftTest/maketest.sh Fri Feb 13 03:09:52 2009
@@ -0,0 +1,3 @@
+#!/bin/sh
+../../../compiler/cpp/thrift --gen csharp -o . ../../ThriftTest.thrift
+gmcs /t:library /out:./ThriftImpl.dll /recurse:./gen-csharp/* /reference:../../../lib/csharp/Thrift.dll
Propchange: incubator/thrift/trunk/test/csharp/ThriftTest/maketest.sh
------------------------------------------------------------------------------
svn:executable = *