Marius Greve Hagen <marius.greve.hagen <at> gmail.com> writes:

> 
> I finaly got it to work, so I will take a look at the HowToContribute link  
> when I've got the time for it :)
> 
> Marius

I've just spent a few minutes porting the Thrift code to compile for Windows
Phone 7 and this is what I have so far:
1) Removed all [Serializable] attributes.
2) Removed the TSocket.cs and TServerSocket.cs files from the project*.
3) Edited the THashSet class like this:
        public class THashSet<T> : ICollection<T>
        {
#if NET_2_0
                TDictSet<T> set = new TDictSet<T>();
#else
#if WINDOWS_PHONE
        List<T> set = new List<T>();
#else
                HashSet<T> set = new HashSet<T>();
#endif
#endif

Now, I'm working on the THttpClient.cs usage of HttpWebRequest which has a
different API on the Windows Phone 7 (they do everything asynchronously).  I
think the best thing to do is implement timeouts in my own HttpWebRequest
sub-class and translate the synchronous connection.GetRequestStream() and
connection.GetResponse() to the asynchronous Windows Phone 7 versions.  This
will take a bit longer.

In that same section of code, the Windows Phone 7 version of HttpWebRequest does
not implement support for the .Proxy member but that is just set to null in the
existing code.

Likewise, the data.Length can just be passed directly to the Stream.Write() call
since the Windows Phone 7 version of HttpWebRequest also lacks a .ContentLength
member.

I haven't yet figured out what I'm going to do about the lack of a
BufferedStream implementation in Windows Phone 7.  This is used in
TBufferedTransport.cs but I don't know how critical it is.

*I'm actually using links to the regular Thrift files so this just means that I
removed the links for those two files.

We'll see if I can knock the rest of this out later today.

Rob.


Reply via email to