diff --git a/examples/chat_server/chat.cpp b/examples/chat_server/chat.cpp index d346281f99..9b629b45fb 100644 --- a/examples/chat_server/chat.cpp +++ b/examples/chat_server/chat.cpp @@ -59,7 +59,7 @@ void chat_server_handler::on_open(session_ptr client) { send_to_all(encode_message("server",m_connections[client]+" has joined the chat.")); } -void chat_server_handler::on_close(session_ptr client,uint16_t status,const std::string &reason) { +void chat_server_handler::on_close(session_ptr client) { std::map::iterator it = m_connections.find(client); if (it == m_connections.end()) { diff --git a/examples/chat_server/chat.hpp b/examples/chat_server/chat.hpp index 3eb9b721ce..0ef21c325c 100644 --- a/examples/chat_server/chat.hpp +++ b/examples/chat_server/chat.hpp @@ -59,7 +59,7 @@ public: void on_open(websocketpp::session_ptr client); // someone disconnected from the lobby, remove them - void on_close(websocketpp::session_ptr client,uint16_t status,const std::string &reason); + void on_close(websocketpp::session_ptr client); void on_message(websocketpp::session_ptr client,const std::string &msg); diff --git a/src/websocket_session.hpp b/src/websocket_session.hpp index 40bc7bc269..d1c7833d8c 100644 --- a/src/websocket_session.hpp +++ b/src/websocket_session.hpp @@ -194,7 +194,7 @@ public: virtual void handle_write_handshake(const boost::system::error_code& e) = 0; virtual void handle_read_handshake(const boost::system::error_code& e, std::size_t bytes_transferred) = 0; -protected: +public: //protected: virtual void write_handshake() = 0; virtual void read_handshake() = 0; diff --git a/windows/.gitignore b/windows/vcpp2008/.gitignore similarity index 100% rename from windows/.gitignore rename to windows/vcpp2008/.gitignore diff --git a/windows/examples/chatclient.vcproj b/windows/vcpp2008/examples/chatclient.vcproj similarity index 88% rename from windows/examples/chatclient.vcproj rename to windows/vcpp2008/examples/chatclient.vcproj index 4919d9f806..929efff01e 100644 --- a/windows/examples/chatclient.vcproj +++ b/windows/vcpp2008/examples/chatclient.vcproj @@ -41,7 +41,7 @@ @@ -191,7 +191,7 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > diff --git a/windows/examples/chatserver.vcproj b/windows/vcpp2008/examples/chatserver.vcproj similarity index 89% rename from windows/examples/chatserver.vcproj rename to windows/vcpp2008/examples/chatserver.vcproj index a0080e75a8..d16f5eb89c 100644 --- a/windows/examples/chatserver.vcproj +++ b/windows/vcpp2008/examples/chatserver.vcproj @@ -41,7 +41,7 @@ @@ -191,7 +191,7 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > diff --git a/windows/examples/echoserver.vcproj b/windows/vcpp2008/examples/echoserver.vcproj similarity index 89% rename from windows/examples/echoserver.vcproj rename to windows/vcpp2008/examples/echoserver.vcproj index f0d6c88bea..f2fc495064 100644 --- a/windows/examples/echoserver.vcproj +++ b/windows/vcpp2008/examples/echoserver.vcproj @@ -41,7 +41,7 @@ @@ -192,7 +192,7 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > diff --git a/windows/stdint.h b/windows/vcpp2008/stdint.h similarity index 100% rename from windows/stdint.h rename to windows/vcpp2008/stdint.h diff --git a/windows/websocketpp.sln b/windows/vcpp2008/websocketpp.sln similarity index 100% rename from windows/websocketpp.sln rename to windows/vcpp2008/websocketpp.sln diff --git a/windows/websocketpp.vcproj b/windows/vcpp2008/websocketpp.vcproj similarity index 77% rename from windows/websocketpp.vcproj rename to windows/vcpp2008/websocketpp.vcproj index deea893c45..eb63530692 100644 --- a/windows/websocketpp.vcproj +++ b/windows/vcpp2008/websocketpp.vcproj @@ -41,7 +41,7 @@ @@ -194,7 +194,7 @@ Name="sha" > @@ -205,46 +205,46 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > @@ -252,7 +252,7 @@ Name="sha" > @@ -260,7 +260,7 @@ Name="utf8_validator" > diff --git a/windows/vcpp2010/.gitignore b/windows/vcpp2010/.gitignore new file mode 100644 index 0000000000..62b99499b0 --- /dev/null +++ b/windows/vcpp2010/.gitignore @@ -0,0 +1,17 @@ +# files to be ignored: +# http://stackoverflow.com/questions/2538149/what-should-be-contained-in-a-global-subversion-ignore-pattern-for-visual-studio +# http://stackoverflow.com/questions/3922660/which-visual-c-file-types-should-be-committed-to-version-control +# http://msdn.microsoft.com/en-us/library/3awe4781%28v=VS.100%29.aspx + +*.user +*.ncb +*.suo +*.sdf +*.opensdf +Debug +Release +examples/*.user +examples/*.ncb +examples/Debug +examples/Release +ipch/* diff --git a/windows/vcpp2010/examples/chatclient.vcxproj b/windows/vcpp2010/examples/chatclient.vcxproj new file mode 100644 index 0000000000..5a07f036a5 --- /dev/null +++ b/windows/vcpp2010/examples/chatclient.vcxproj @@ -0,0 +1,108 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {116BFEDA-AF8E-4B3F-8508-ACC5EE89F905} + chatclient + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + + + + Disabled + $(BOOSTROOT);..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;NOCOMM;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(BOOSTROOT)\stage\lib;%(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + MaxSpeed + true + $(BOOSTROOT);..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;NOCOMM;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions) + MultiThreaded + false + true + StreamingSIMDExtensions2 + + + Level3 + + + + + $(BOOSTROOT)\stage\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + + + + + + + + {1c0fd04e-5aca-4031-b3d1-320a5360c9d0} + false + + + + + + \ No newline at end of file diff --git a/windows/vcpp2010/examples/chatclient.vcxproj.filters b/windows/vcpp2010/examples/chatclient.vcxproj.filters new file mode 100644 index 0000000000..34e66c830b --- /dev/null +++ b/windows/vcpp2010/examples/chatclient.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/windows/vcpp2010/examples/chatserver.vcxproj b/windows/vcpp2010/examples/chatserver.vcxproj new file mode 100644 index 0000000000..bfdec866f8 --- /dev/null +++ b/windows/vcpp2010/examples/chatserver.vcxproj @@ -0,0 +1,108 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {2AFECE48-86DE-47D0-9263-DC0D203AA62D} + chatserver + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + + + + Disabled + $(BOOSTROOT);..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;NOCOMM;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(BOOSTROOT)\stage\lib;%(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + MaxSpeed + true + $(BOOSTROOT);..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;NOCOMM;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions) + MultiThreaded + false + true + StreamingSIMDExtensions2 + + + Level3 + + + + + $(BOOSTROOT)\stage\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + + + + + + + + {1c0fd04e-5aca-4031-b3d1-320a5360c9d0} + false + + + + + + \ No newline at end of file diff --git a/windows/vcpp2010/examples/chatserver.vcxproj.filters b/windows/vcpp2010/examples/chatserver.vcxproj.filters new file mode 100644 index 0000000000..e2ea4bd9dd --- /dev/null +++ b/windows/vcpp2010/examples/chatserver.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/windows/vcpp2010/examples/echoclient.vcxproj b/windows/vcpp2010/examples/echoclient.vcxproj new file mode 100644 index 0000000000..281a304a64 --- /dev/null +++ b/windows/vcpp2010/examples/echoclient.vcxproj @@ -0,0 +1,99 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {D7C36001-002F-4B8E-B4C0-A04E2F9522D0} + Win32Proj + echoclient + + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;NOCOMM;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions) + $(BOOSTROOT);..;%(AdditionalIncludeDirectories) + MultiThreadedDebug + + + Console + true + $(BOOSTROOT)\stage\lib;%(AdditionalLibraryDirectories) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;NOCOMM;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions) + $(BOOSTROOT);..;%(AdditionalIncludeDirectories) + MultiThreaded + false + StreamingSIMDExtensions2 + + + Console + true + true + true + $(BOOSTROOT)\stage\lib;%(AdditionalLibraryDirectories) + + + + + + + + + + + + {1c0fd04e-5aca-4031-b3d1-320a5360c9d0} + + + + + + \ No newline at end of file diff --git a/windows/vcpp2010/examples/echoclient.vcxproj.filters b/windows/vcpp2010/examples/echoclient.vcxproj.filters new file mode 100644 index 0000000000..765ace9c46 --- /dev/null +++ b/windows/vcpp2010/examples/echoclient.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/windows/vcpp2010/examples/echoserver.vcxproj b/windows/vcpp2010/examples/echoserver.vcxproj new file mode 100644 index 0000000000..eeace56e03 --- /dev/null +++ b/windows/vcpp2010/examples/echoserver.vcxproj @@ -0,0 +1,109 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {B569A272-D7D3-404B-B5FB-9187C0EB9F48} + examples + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + false + + + + Disabled + $(BOOSTROOT);..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;NOCOMM;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + StreamingSIMDExtensions2 + + + Level3 + ProgramDatabase + + + $(BOOSTROOT)\stage\lib;%(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + MaxSpeed + true + $(BOOSTROOT);..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;NOCOMM;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions) + MultiThreaded + false + true + StreamingSIMDExtensions2 + + + Level3 + + + + + $(BOOSTROOT)\stage\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + + + + + + + + {1c0fd04e-5aca-4031-b3d1-320a5360c9d0} + false + + + + + + \ No newline at end of file diff --git a/windows/vcpp2010/examples/echoserver.vcxproj.filters b/windows/vcpp2010/examples/echoserver.vcxproj.filters new file mode 100644 index 0000000000..a62d813e87 --- /dev/null +++ b/windows/vcpp2010/examples/echoserver.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/windows/vcpp2010/readme.txt b/windows/vcpp2010/readme.txt new file mode 100644 index 0000000000..d32437e126 --- /dev/null +++ b/windows/vcpp2010/readme.txt @@ -0,0 +1,35 @@ +Build Boost +=========== + +Prerequisites: Visual Sutdio C ++ 2010 Express (or higher) + +Download Boost from http://www.boost.org/ + +Unzip boost_1_47_0.zip to C:\boost_1_47_0 + +Open a "Visual Studio Command Prompt (2010)" (not a regular cmd.exe!). + +cd C:\boost_1_47_0 + +bootstrap + +.\b2 runtime-link=static + +Now set a system environment variable: + +BOOSTROOT = C:\boost_1_47_0 + + +Background: + + - http://www.boost.org/doc/libs/1_47_0/more/getting_started/windows.html + - http://www.boost.org/doc/libs/1_47_0/more/getting_started/windows.html#library-naming + - http://stackoverflow.com/questions/2035287/static-runtime-library-linking-for-visual-c-express-2008 + + +Build websocket++ +================= + +Open websocketpp.sln in VS. + +Build Solution (F7). diff --git a/windows/vcpp2010/websocketpp.sln b/windows/vcpp2010/websocketpp.sln new file mode 100644 index 0000000000..4139952bfa --- /dev/null +++ b/windows/vcpp2010/websocketpp.sln @@ -0,0 +1,47 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "websocketpp", "websocketpp.vcxproj", "{1C0FD04E-5ACA-4031-B3D1-320A5360C9D0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoserver", "examples\echoserver.vcxproj", "{B569A272-D7D3-404B-B5FB-9187C0EB9F48}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chatserver", "examples\chatserver.vcxproj", "{2AFECE48-86DE-47D0-9263-DC0D203AA62D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chatclient", "examples\chatclient.vcxproj", "{116BFEDA-AF8E-4B3F-8508-ACC5EE89F905}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoclient", "examples\echoclient.vcxproj", "{D7C36001-002F-4B8E-B4C0-A04E2F9522D0}" + ProjectSection(ProjectDependencies) = postProject + {1C0FD04E-5ACA-4031-B3D1-320A5360C9D0} = {1C0FD04E-5ACA-4031-B3D1-320A5360C9D0} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1C0FD04E-5ACA-4031-B3D1-320A5360C9D0}.Debug|Win32.ActiveCfg = Debug|Win32 + {1C0FD04E-5ACA-4031-B3D1-320A5360C9D0}.Debug|Win32.Build.0 = Debug|Win32 + {1C0FD04E-5ACA-4031-B3D1-320A5360C9D0}.Release|Win32.ActiveCfg = Release|Win32 + {1C0FD04E-5ACA-4031-B3D1-320A5360C9D0}.Release|Win32.Build.0 = Release|Win32 + {B569A272-D7D3-404B-B5FB-9187C0EB9F48}.Debug|Win32.ActiveCfg = Debug|Win32 + {B569A272-D7D3-404B-B5FB-9187C0EB9F48}.Debug|Win32.Build.0 = Debug|Win32 + {B569A272-D7D3-404B-B5FB-9187C0EB9F48}.Release|Win32.ActiveCfg = Release|Win32 + {B569A272-D7D3-404B-B5FB-9187C0EB9F48}.Release|Win32.Build.0 = Release|Win32 + {2AFECE48-86DE-47D0-9263-DC0D203AA62D}.Debug|Win32.ActiveCfg = Debug|Win32 + {2AFECE48-86DE-47D0-9263-DC0D203AA62D}.Debug|Win32.Build.0 = Debug|Win32 + {2AFECE48-86DE-47D0-9263-DC0D203AA62D}.Release|Win32.ActiveCfg = Release|Win32 + {2AFECE48-86DE-47D0-9263-DC0D203AA62D}.Release|Win32.Build.0 = Release|Win32 + {116BFEDA-AF8E-4B3F-8508-ACC5EE89F905}.Debug|Win32.ActiveCfg = Debug|Win32 + {116BFEDA-AF8E-4B3F-8508-ACC5EE89F905}.Debug|Win32.Build.0 = Debug|Win32 + {116BFEDA-AF8E-4B3F-8508-ACC5EE89F905}.Release|Win32.ActiveCfg = Release|Win32 + {116BFEDA-AF8E-4B3F-8508-ACC5EE89F905}.Release|Win32.Build.0 = Release|Win32 + {D7C36001-002F-4B8E-B4C0-A04E2F9522D0}.Debug|Win32.ActiveCfg = Debug|Win32 + {D7C36001-002F-4B8E-B4C0-A04E2F9522D0}.Debug|Win32.Build.0 = Debug|Win32 + {D7C36001-002F-4B8E-B4C0-A04E2F9522D0}.Release|Win32.ActiveCfg = Release|Win32 + {D7C36001-002F-4B8E-B4C0-A04E2F9522D0}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/windows/vcpp2010/websocketpp.vcxproj b/windows/vcpp2010/websocketpp.vcxproj new file mode 100644 index 0000000000..0ba1ca8384 --- /dev/null +++ b/windows/vcpp2010/websocketpp.vcxproj @@ -0,0 +1,105 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {1C0FD04E-5ACA-4031-B3D1-320A5360C9D0} + websocketpp + Win32Proj + + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + + Disabled + $(BOOSTROOT);.;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;WIN32_LEAN_AND_MEAN;NOCOMM;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreaded + StreamingSIMDExtensions2 + + + Level3 + EditAndContinue + + + + + MaxSpeed + true + Speed + $(BOOSTROOT);.;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;WIN32_LEAN_AND_MEAN;NOCOMM;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions) + MultiThreaded + false + true + StreamingSIMDExtensions2 + + + Level3 + ProgramDatabase + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/windows/vcpp2010/websocketpp.vcxproj.filters b/windows/vcpp2010/websocketpp.vcxproj.filters new file mode 100644 index 0000000000..ace00626f3 --- /dev/null +++ b/windows/vcpp2010/websocketpp.vcxproj.filters @@ -0,0 +1,95 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {79820f1e-61d9-46bc-9eb2-a52c20f62fa4} + + + {b6f4bad9-f45a-495f-93f2-f4b1605b9ac4} + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {d7e1c798-4217-4c1e-a897-90bfc59d83ad} + + + {84b75a09-d8c9-4327-806d-c4f54698e4c5} + + + {c849b58d-df43-4574-ae85-92ac66333899} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\base64 + + + Source Files\sha + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files\base64 + + + Header Files\sha + + + Header Files\utf8_validator + + +