[ 
https://issues.apache.org/jira/browse/THRIFT-311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12742928#action_12742928
 ] 

Rush Manbert commented on THRIFT-311:
-------------------------------------

It has been a long time coming, but I believe that the MSVC port is finally 
ready to post and let other people test.

The patch file was generated against the SVN repository revision 803313. It 
patches the entire distribution tree, but only touches things that are C++ 
related.

The patch addresses the following unresolved Jira issues:
Thrift-456 (https://issues.apache.org/jira/browse/THRIFT-456) 
Thrift-457 (https://issues.apache.org/jira/browse/THRIFT-457)
Thrift-487 (https://issues.apache.org/jira/browse/THRIFT-487)
Thrift-488 (https://issues.apache.org/jira/browse/THRIFT-488)

It also makes changes that are not issues in Jira. For instance:
        1.      Autoconf support has been extended to all of the C++ tests, as 
well as the tutorial.
        2.      The stress-test and stress-test-nb have been extensively 
reworked to make them more versatile and reliable. I relied on these a lot 
during my development to test the new socket and server code.
        3.      The concurrency test has been extensively reworked to make it 
be reliable and more versatile. I work on a 8 core machine and the test as 
distributed just doesn't work reliably in that environment. I used this test to 
verify all of my Boost threading changes.
        4.      All of the sources have been touched to add Windows-specific 
support, but I suppose that could be seen as part of this Jira issue. :-)



Disclaimers:
-----------
I had never done anything with autoconf before this. What I have done may not 
be correct. If changes are required, please let me know.

The configure script displays information at the end that is related to the new 
configuration stuff. It was useful for me while developing and I thought it 
might be a good idea to leave it in for a while.

I'm really not a Windows guy, I just do what needs doing. If any of you are 
Windows experts, and you have suggestions or corrections, please let me know.

See the "Known Issues" section in the msvc/README file. 

Licensing
Obviously, I checked the box that says I grant the license to Apache for this 
code. There is one file, though, that already had a license header within it. 
That is the file lib/cpp/src/VisualStudioStdint.h, and it contains this notice:

// ISO C9x  compliant stdint.h for Miscrosoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
// 
//  Copyright (c) 2006 Alexander Chemeris
// 
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// 
//   1. Redistributions of source code must retain the above copyright notice,
//      this list of conditions and the following disclaimer.
// 
//   2. Redistributions in binary form must reproduce the above copyright
//      notice, this list of conditions and the following disclaimer in the
//      documentation and/or other materials provided with the distribution.
// 
//   3. The name of the author may be used to endorse or promote products
//      derived from this software without specific prior written permission.
// 
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// 
///////////////////////////////////////////////////////////////////////////////

I did not add an Apache license header to this file. I do not know what should 
be done. It can obviously be used, but there must be some requirement for dual 
licensing.



To apply the patch, do the following:
------------------------------------
1. Checkout from SVN:
  svn co --revision 803313 
http://svn.apache.org/repos/asf/incubator/thrift/trunk thrift

Note the --revision argument. The patch might work against other revisions, or 
it might not.

2. Make a copy of your distribution directory, because patch will patch the 
directory it works on in place.

3. Get the patch file from Jira by following this link:
  https://issues.apache.org/jira/browse/THRIFT-311

  Use the links there to download the patch file.

4. cd to the renamed distribution directory

5. Apply the patch by execution:
  patch -p 8 <patchFile

  where patchFile is the path to your downloaded patch file.



After applying the patch, the top level README file will have information about 
the new "msvc" subdirectory. The new file CPP_LIB_CFG has information about the 
configurations that are possible on *nix systems. Configurations can keep 
things the way they are currently, or can add-to and/or replace existing 
functionality with new functionality provided by Asio/Boost. (I had to do it 
this way so that I could use the existing test code with my new classes.)

The "msvc" subdirectory has its own README file that contains information 
particular to the msvc port. There are other msvc subdirectories spread through 
the tree. They follow a pattern, and they are all documented in the new README.

Tested Platforms:
----------------
Mac OS X 10.5.7 (me)
Gentoo Linux (Bruce Simpson)
FreeBSD (Bruce Simpson)
Windows XP (me)

Tested Boost and Asio versions:
------------------------------
Standalone Asio 1.2.0 and 1.4.1
On the Mac: Boost 1.36.0, 1.37.0, 1.38.0, and 1.39.0
On Windows XP: Boost 1.36.0

Along with the patch, I will attach a zip file called 
"MsvcPatchSupportScripts.zip" that contains a number of scripts that are useful 
for testing all of the variations (there are 10) on a *nix system. These 
scripts assume a very specific directory structure. It is documented in only 
one of them. Sorry. If you run "./buildAll.sh --help" at the command line, it 
will show you what is expected. It also documents two environment variables you 
can use with the scripts. They are called  THRIFT_DEV_ROOT and 
THRIFT_DISTRO_DIR. Note that the scripts are designed to be run from the 
directory ABOVE your patched distribution directory.

The various scripts are:
buildAll.sh - Builds all the possible configuration variants by copying the 
distribution directory, then configuring and building. If you are on a Mac, be 
sure to copy your pkg.m4 file into the aclocal subdirectory of the distribution 
tree before you run this script. The build results are written into files 
called Log_* in the same directory as the script.

buildTutorialAll.sh - After buildAll.sh has run, this script iterates over all 
of the directories that were created and verifies that the C++ tutorial can be 
built both using the auto-generated Makefile and the Tutorial.mk makefile. It 
cleans up after itself. 

clean.sh - Finds and removes all of the subdirectory trees and log files that 
are written by buildAll.sh.

concurrencyTest.sh - After buildAll.sh has run, this script iterates over all 
the directories that were created, runs the concurrency test in each of them 
and verifies that the test runs successfully.

cpCfgAndBuild.sh - This script knows how to configure and build Thrift in a 
single directory, but all it cares about is the C++ stuff. It also runs "make 
check". This script is used by the buildAll.sh script. This script currently 
defines the macro THRIFT_ENABLE_CONFIG_WARNINGS via CPPFLAGS. That generates 
warning messages at library compile time that tell you about the configuration. 
Remove the macro definition from the script if you don't want the warnings. 
(Just search for the macro name in the script file. What to do is pretty 
obvious once you find it.)

doTest.sh - This script runs the standard "make check" test suite on a single 
directory. It is used by the testAll.sh script.

findThriftDistro.sh - This script attempts to locate the Thrift distribution 
directory. It looks at the directory passed as the script argument if there is 
one, or it examines the environment variables THRIFT_DEV_ROOT and 
THRIFT_DISTRO_DIR if they are set. This script is used by many of the others, 
and you shouldn't need to mess with it.

testAll.sh - After buildAll.sh has run, this script iterates over all of the 
directories that were created and runs the standard test suite in each of them.


I hope others find this to be useful.

> ASIO client & server
> --------------------
>
>                 Key: THRIFT-311
>                 URL: https://issues.apache.org/jira/browse/THRIFT-311
>             Project: Thrift
>          Issue Type: Sub-task
>          Components: Library (C++)
>            Reporter: Esteve Fernandez
>         Attachments: MsvcPatchSupportScripts.zip, thrift_connection.cpp, 
> thrift_connection.hpp, thrift_connection_v2.cpp, thrift_handler.cpp, 
> thrift_handler.hpp, thrift_main.cpp, thrift_server.cpp, thrift_server.hpp, 
> ThriftCalculatorASIOServer.cpp, ThriftMsvcPatchForSvnRev803313.txt
>
>
> Given the recent discussion on a Windows port and moving to ASIO 
> (http://mail-archives.apache.org/mod_mbox/incubator-thrift-dev/200901.mbox/%[email protected]%3e),
>  I decided to hack a little Thrift asynchronous prototype server using ASIO 
> and here's the result. It implements the Calculator service that can be found 
> in the tutorial and, just like TNonblockingServer, it uses a FramedTransport.
> It's just a quick prototype, but I think it's enough for building a more 
> generic server/protocol. I've only tested it in Linux, but I think there's 
> nothing platform-dependent and can be compiled "as is" in Windows.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to