Solved

Thrift (Facebook API) newbie question

Posted on 2011-09-12
6
1,305 Views
Last Modified: 2012-05-12
Hi all,

I'm about to implement a TCP/IP communication infrastructure for communicating between C# & C++ applications on windows platform.
I considered implementing this from scratch, but then I stumbled upon Thrift (Facebook communication API), and from what I read it looks quite nice.
However, after downloading it and attempting to implement a basic sample, I feel a bit at loss...

Any help would be appreciated.
Thanks in advance.
0
Comment
Question by:AUROS
  • 3
  • 3
6 Comments
 

Accepted Solution

by:
AUROS earned 0 total points
ID: 36522787
Issue is no issue...
When creating thrift files using VS2010 the thrift compiler didn't like them, and generated empty output.
When creating the same files using VS2008 or notepad, all is good...
0
 
LVL 40

Expert Comment

by:evilrix
ID: 36525699
Not sure I follow you solution. The thrift compiler doesn't use Visual studio to generate the thrift bindings from its IDL.

Glad you got it working but just slightly concerned the solution you've accepted might be a little misleading.
0
 

Author Comment

by:AUROS
ID: 36525888
I was simply using VS to write the .thrift files.
Apparently, VS2010 saves the files as UTF8, which the compiler treats as empty files (with no errors). VS2008 saves the files as ASCII by default, which works fine for the Thrift compiler. So in VS2010 you simply have to "Save As" each thrift file, and change it's encoding - haven't found anything better (except for not using VS2010).
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 40

Expert Comment

by:evilrix
ID: 36526659
Ok, that makes a little more sense.

You should consider using Notepad++. I have a syntax highlighting file for thrift I can share with you if you do :)
0
 

Author Comment

by:AUROS
ID: 36527605
If you can send it, that would be great!
0
 
LVL 40

Expert Comment

by:evilrix
ID: 36528097
To use add the <UserLang> node to the <NotepadPlus> node of your C:\Users\[USERNAME]\AppData\Roaming\Notepad++\userDefineLang.xml file.

It's possibly a little out of date but it should cover most things and you can always add to it as you wish.
<NotepadPlus>
    <UserLang name="thrift" ext="thrift">
        <Settings>
            <Global caseIgnored="no" />
            <TreatAsSymbol comment="yes" commentLine="yes" />
            <Prefix words1="no" words2="no" words3="no" words4="no" />
        </Settings>
        <KeywordLists>
            <Keywords name="Delimiters">&quot;00&quot;00</Keywords>
            <Keywords name="Folder+"></Keywords>
            <Keywords name="Folder-"></Keywords>
            <Keywords name="Operators">( ) , : { } &lt; &gt;</Keywords>
            <Keywords name="Comment">1/* 2*/ 0// 0#</Keywords>
            <Keywords name="Words1">final namespace throws include required extend oneway</Keywords>
            <Keywords name="Words2">enum struct service exception</Keywords>
            <Keywords name="Words3">list i64 i32 i16 double string bool void map set binary</Keywords>
            <Keywords name="Words4"></Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD1" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD2" styleID="6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
            <WordsStyle name="KEYWORD3" styleID="7" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD4" styleID="8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="NUMBER" styleID="4" fgColor="804000" bgColor="FFFFFF" fontName="" fontStyle="1" />
            <WordsStyle name="OPERATOR" styleID="10" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER1" styleID="14" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
        </Styles>
    </UserLang>
</NotepadPlus>

Open in new window

0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Exit the loop 4 43
SqlDataBase 7 48
C# bracket error 3 32
RegEx with optional part 4 24
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question