├── .gitignore ├── CMakeLists.txt ├── Config.cmake.in ├── LICENSE ├── README.md ├── easy-socket.sln ├── easy-socket.vcxproj ├── easy-socket.vcxproj.filters ├── include └── masesk │ └── EasySocket.hpp └── test ├── test-client ├── CMakeLists.txt ├── Client.cpp ├── test-client.vcxproj └── test-client.vcxproj.filters └── test-server ├── CMakeLists.txt ├── Server.cpp ├── test-server.vcxproj └── test-server.vcxproj.filters /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # ASP.NET Scaffolding 66 | ScaffoldingReadMe.txt 67 | 68 | # StyleCop 69 | StyleCopReport.xml 70 | 71 | # Files built by Visual Studio 72 | *_i.c 73 | *_p.c 74 | *_h.h 75 | *.ilk 76 | *.meta 77 | *.obj 78 | *.iobj 79 | *.pch 80 | *.pdb 81 | *.ipdb 82 | *.pgc 83 | *.pgd 84 | *.rsp 85 | *.sbr 86 | *.tlb 87 | *.tli 88 | *.tlh 89 | *.tmp 90 | *.tmp_proj 91 | *_wpftmp.csproj 92 | *.log 93 | *.vspscc 94 | *.vssscc 95 | .builds 96 | *.pidb 97 | *.svclog 98 | *.scc 99 | 100 | # Chutzpah Test files 101 | _Chutzpah* 102 | 103 | # Visual C++ cache files 104 | ipch/ 105 | *.aps 106 | *.ncb 107 | *.opendb 108 | *.opensdf 109 | *.sdf 110 | *.cachefile 111 | *.VC.db 112 | *.VC.VC.opendb 113 | 114 | # Visual Studio profiler 115 | *.psess 116 | *.vsp 117 | *.vspx 118 | *.sap 119 | 120 | # Visual Studio Trace Files 121 | *.e2e 122 | 123 | # TFS 2012 Local Workspace 124 | $tf/ 125 | 126 | # Guidance Automation Toolkit 127 | *.gpState 128 | 129 | # ReSharper is a .NET coding add-in 130 | _ReSharper*/ 131 | *.[Rr]e[Ss]harper 132 | *.DotSettings.user 133 | 134 | # TeamCity is a build add-in 135 | _TeamCity* 136 | 137 | # DotCover is a Code Coverage Tool 138 | *.dotCover 139 | 140 | # AxoCover is a Code Coverage Tool 141 | .axoCover/* 142 | !.axoCover/settings.json 143 | 144 | # Coverlet is a free, cross platform Code Coverage Tool 145 | coverage*.json 146 | coverage*.xml 147 | coverage*.info 148 | 149 | # Visual Studio code coverage results 150 | *.coverage 151 | *.coveragexml 152 | 153 | # NCrunch 154 | _NCrunch_* 155 | .*crunch*.local.xml 156 | nCrunchTemp_* 157 | 158 | # MightyMoose 159 | *.mm.* 160 | AutoTest.Net/ 161 | 162 | # Web workbench (sass) 163 | .sass-cache/ 164 | 165 | # Installshield output folder 166 | [Ee]xpress/ 167 | 168 | # DocProject is a documentation generator add-in 169 | DocProject/buildhelp/ 170 | DocProject/Help/*.HxT 171 | DocProject/Help/*.HxC 172 | DocProject/Help/*.hhc 173 | DocProject/Help/*.hhk 174 | DocProject/Help/*.hhp 175 | DocProject/Help/Html2 176 | DocProject/Help/html 177 | 178 | # Click-Once directory 179 | publish/ 180 | 181 | # Publish Web Output 182 | *.[Pp]ublish.xml 183 | *.azurePubxml 184 | # Note: Comment the next line if you want to checkin your web deploy settings, 185 | # but database connection strings (with potential passwords) will be unencrypted 186 | *.pubxml 187 | *.publishproj 188 | 189 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 190 | # checkin your Azure Web App publish settings, but sensitive information contained 191 | # in these scripts will be unencrypted 192 | PublishScripts/ 193 | 194 | # NuGet Packages 195 | *.nupkg 196 | # NuGet Symbol Packages 197 | *.snupkg 198 | # The packages folder can be ignored because of Package Restore 199 | **/[Pp]ackages/* 200 | # except build/, which is used as an MSBuild target. 201 | !**/[Pp]ackages/build/ 202 | # Uncomment if necessary however generally it will be regenerated when needed 203 | #!**/[Pp]ackages/repositories.config 204 | # NuGet v3's project.json files produces more ignorable files 205 | *.nuget.props 206 | *.nuget.targets 207 | 208 | # Microsoft Azure Build Output 209 | csx/ 210 | *.build.csdef 211 | 212 | # Microsoft Azure Emulator 213 | ecf/ 214 | rcf/ 215 | 216 | # Windows Store app package directories and files 217 | AppPackages/ 218 | BundleArtifacts/ 219 | Package.StoreAssociation.xml 220 | _pkginfo.txt 221 | *.appx 222 | *.appxbundle 223 | *.appxupload 224 | 225 | # Visual Studio cache files 226 | # files ending in .cache can be ignored 227 | *.[Cc]ache 228 | # but keep track of directories ending in .cache 229 | !?*.[Cc]ache/ 230 | 231 | # Others 232 | ClientBin/ 233 | ~$* 234 | *~ 235 | *.dbmdl 236 | *.dbproj.schemaview 237 | *.jfm 238 | *.pfx 239 | *.publishsettings 240 | orleans.codegen.cs 241 | 242 | # Including strong name files can present a security risk 243 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 244 | #*.snk 245 | 246 | # Since there are multiple workflows, uncomment next line to ignore bower_components 247 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 248 | #bower_components/ 249 | 250 | # RIA/Silverlight projects 251 | Generated_Code/ 252 | 253 | # Backup & report files from converting an old project file 254 | # to a newer Visual Studio version. Backup files are not needed, 255 | # because we have git ;-) 256 | _UpgradeReport_Files/ 257 | Backup*/ 258 | UpgradeLog*.XML 259 | UpgradeLog*.htm 260 | ServiceFabricBackup/ 261 | *.rptproj.bak 262 | 263 | # SQL Server files 264 | *.mdf 265 | *.ldf 266 | *.ndf 267 | 268 | # Business Intelligence projects 269 | *.rdl.data 270 | *.bim.layout 271 | *.bim_*.settings 272 | *.rptproj.rsuser 273 | *- [Bb]ackup.rdl 274 | *- [Bb]ackup ([0-9]).rdl 275 | *- [Bb]ackup ([0-9][0-9]).rdl 276 | 277 | # Microsoft Fakes 278 | FakesAssemblies/ 279 | 280 | # GhostDoc plugin setting file 281 | *.GhostDoc.xml 282 | 283 | # Node.js Tools for Visual Studio 284 | .ntvs_analysis.dat 285 | node_modules/ 286 | 287 | # Visual Studio 6 build log 288 | *.plg 289 | 290 | # Visual Studio 6 workspace options file 291 | *.opt 292 | 293 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 294 | *.vbw 295 | 296 | # Visual Studio LightSwitch build output 297 | **/*.HTMLClient/GeneratedArtifacts 298 | **/*.DesktopClient/GeneratedArtifacts 299 | **/*.DesktopClient/ModelManifest.xml 300 | **/*.Server/GeneratedArtifacts 301 | **/*.Server/ModelManifest.xml 302 | _Pvt_Extensions 303 | 304 | # Paket dependency manager 305 | .paket/paket.exe 306 | paket-files/ 307 | 308 | # FAKE - F# Make 309 | .fake/ 310 | 311 | # CodeRush personal settings 312 | .cr/personal 313 | 314 | # Python Tools for Visual Studio (PTVS) 315 | __pycache__/ 316 | *.pyc 317 | 318 | # Cake - Uncomment if you are using it 319 | # tools/** 320 | # !tools/packages.config 321 | 322 | # Tabs Studio 323 | *.tss 324 | 325 | # Telerik's JustMock configuration file 326 | *.jmconfig 327 | 328 | # BizTalk build output 329 | *.btp.cs 330 | *.btm.cs 331 | *.odx.cs 332 | *.xsd.cs 333 | 334 | # OpenCover UI analysis results 335 | OpenCover/ 336 | 337 | # Azure Stream Analytics local run output 338 | ASALocalRun/ 339 | 340 | # MSBuild Binary and Structured Log 341 | *.binlog 342 | 343 | # NVidia Nsight GPU debugger configuration file 344 | *.nvuser 345 | 346 | # MFractors (Xamarin productivity tool) working folder 347 | .mfractor/ 348 | 349 | # Local History for Visual Studio 350 | .localhistory/ 351 | 352 | # BeatPulse healthcheck temp database 353 | healthchecksdb 354 | 355 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 356 | MigrationBackup/ 357 | 358 | # Ionide (cross platform F# VS Code tools) working folder 359 | .ionide/ 360 | 361 | # Fody - auto-generated XML schema 362 | FodyWeavers.xsd 363 | 364 | # Prerequisites 365 | *.d 366 | 367 | # Compiled Object files 368 | *.slo 369 | *.lo 370 | *.o 371 | *.obj 372 | 373 | # Precompiled Headers 374 | *.gch 375 | *.pch 376 | 377 | # Compiled Dynamic libraries 378 | *.so 379 | *.dylib 380 | *.dll 381 | 382 | # Fortran module files 383 | *.mod 384 | *.smod 385 | 386 | # Compiled Static libraries 387 | *.lai 388 | *.la 389 | *.a 390 | *.lib 391 | 392 | # Executables 393 | *.exe 394 | *.out 395 | *.app 396 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.5) 2 | 3 | project(easy-socket VERSION 0.2.0) 4 | 5 | option(EASY_SOCKET_BUILD_TESTS "Turn on to build tests." ON) 6 | 7 | set(PROJECT_COMPATIBILITY AnyNewerVersion) 8 | add_library(${PROJECT_NAME} INTERFACE) 9 | target_include_directories(${PROJECT_NAME} INTERFACE $) 10 | 11 | set(target_dependencies "") 12 | if(WIN32) 13 | list(APPEND target_dependencies wsock32 ws2_32) 14 | endif() 15 | 16 | target_link_libraries(${PROJECT_NAME} INTERFACE ${target_dependencies}) 17 | 18 | include(CMakePackageConfigHelpers) 19 | write_basic_package_version_file( 20 | "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" 21 | VERSION ${PROJECT_VERSION} 22 | COMPATIBILITY ${PROJECT_COMPATIBILITY} 23 | ) 24 | 25 | install( 26 | TARGETS ${PROJECT_NAME} 27 | EXPORT ${PROJECT_NAME}Targets 28 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Runtime 29 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Development 30 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Runtime 31 | BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Runtime 32 | PUBLIC_HEADER DESTINATION ${INCLUDE_DESTINATION} COMPONENT Development 33 | ) 34 | 35 | configure_package_config_file( 36 | ${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in 37 | "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" 38 | INSTALL_DESTINATION lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION} 39 | ) 40 | 41 | install( 42 | EXPORT ${PROJECT_NAME}Targets 43 | DESTINATION lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION} 44 | ) 45 | 46 | install( 47 | FILES 48 | "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" 49 | "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" 50 | DESTINATION 51 | lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION} 52 | ) 53 | 54 | install( 55 | DIRECTORY ${PROJECT_SOURCE_DIR}/include/ 56 | DESTINATION include 57 | ) 58 | 59 | set(${PROJECT_NAME}_VERSION ${PROJECT_VERSION} CACHE INTERNAL "") 60 | 61 | if(EASY_SOCKET_BUILD_TESTS) 62 | # Add sub directories 63 | add_subdirectory(test/test-server) 64 | add_subdirectory(test/test-client) 65 | endif() 66 | -------------------------------------------------------------------------------- /Config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(CMakeFindDependencyMacro) 4 | 5 | foreach(dependency @PROJECT_DEPENDENCIES@) 6 | find_dependency(${dependency}) 7 | endforeach() 8 | 9 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") 10 | check_required_components("@PROJECT_NAME@") -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # easy-socket 2 | Modern C++ 11 native, OS agnostic, socket library/starter code with a single header include 3 | 4 | [![license](https://img.shields.io/github/license/masesk/easy-socket.svg)](https://github.com/masesk/easy-socket/blob/master/LICENSE) 5 | [![stars](https://img.shields.io/github/stars/masesk/easy-socket.svg?style=social)](https://github.com/masesk/easy-socket/stargazers) 6 | [![forks](https://img.shields.io/github/forks/masesk/easy-socket?style=social)](https://github.com/masesk/easy-socket/network/members) 7 | 8 | ## Features 9 | * Easy: Start using simple socket features by including a single header file 10 | * Portable: Works on Windows and Linux 11 | * Configurable: All sockets configurations and settings can easily be accessed and changed from the header file. 12 | 13 | ## Requirements 14 | * C++ 11 and up 15 | 16 | ## Namespace, Usecase, Members, Functions 17 | 18 | ### Import: 19 | ``` 20 | #include 21 | ``` 22 | 23 | ### Namespace and Initialize 24 | 25 | ``` 26 | masesk::EasySocket easySocket; //or using namespace masesk; 27 | ``` 28 | 29 | ### Usecase 30 | 31 | * EasySocket wraps the code for the server and client, so that a single header can be used to initialize and start a server or a client. 32 | ```cpp 33 | //server example 34 | 35 | #include 36 | #include 37 | using namespace std; 38 | using namespace masesk; 39 | 40 | void handleData(const std::string &data) { 41 | cout << "Client sent: " + data << endl; 42 | } 43 | 44 | int main() { 45 | EasySocket socketManager; 46 | socketManager.socketListen("test", 8080, &handleData); 47 | return 0; 48 | } 49 | ``` 50 | 51 | ```cpp 52 | // client example 53 | #include 54 | #include 55 | #include 56 | using namespace std; 57 | using namespace masesk; 58 | int main() { 59 | EasySocket socketManager; 60 | socketManager.socketConnect("test", "127.0.0.1", 8080); 61 | socketManager.socketSend("test", "Hello from client!"); 62 | socketManager.closeConnection("test"); 63 | return 0; 64 | } 65 | ``` 66 | 67 | ### Functions 68 | 69 | #### Server Functions 70 | 71 | * `void socketListen(std::string channelName, int port, std::function callback);` 72 | * channelName: string identifier of channel 73 | * port: integer value of port used on server side (eg. 8080) 74 | * function: pointer of function that will be called to handle the data when the server recieves data from the client 75 | 76 | #### Client Functions 77 | 78 | * `void socketConnect(std::string channelName, std::string ip, int port)` - start a new connection with a server with a channel name, ip address of the server, and the port the server would be listening on. 79 | * channelName - string identifier of channel 80 | * ip - string for where the server resides (eg. 127.0.0.1 for local) 81 | * port - integer value of port used on server side (eg. 8080) 82 | * `void socketSend(std::string channelName, std::string data)` - send data to server based on channel name 83 | * channelName: string identifier of channel 84 | * data: data to be sent through to the server on given channel 85 | * `void closeConnection(std::string channelName)` - close connection with server using channel name 86 | * channelName: string identifier of channel 87 | 88 | ## Example 89 | Check `test/test-server` and `test/test-client` for a working client and server example running locally. 90 | 91 | ### Build Tests on Windows 92 | 1. Open `easy-socket.sln` in Visual Studio 2017 93 | 2. Right click on `test-client`, select `properites`, and change `Windows SDK Version` to your installed 10.x 94 | 3. Right click on `test-server`, select `properites`, and change `Windows SDK Version` to your installed 10.x 95 | 4. Right click on ```Solution 'easy-socket' ``` and select `Rebuild entire solution`. 96 | 5. Select desired `Configuration` (Debug/Release) and `Platform` (x64/Win32) from the top-bar dropdowns next to the start button. 97 | 6. Executables will be available at `[x64 or Win32]/[Debug or Release]` 98 | 99 | ### Build Tests on Linux 100 | 101 | Requirements: 102 | * CMake (> v3.5) 103 | * make 104 | * g++ (> v6.1) 105 | 106 | ``` 107 | mkdir build 108 | ``` 109 | ``` 110 | cd build 111 | ``` 112 | ``` 113 | cmake .. 114 | ``` 115 | ``` 116 | make 117 | ``` 118 | 119 | Executables will be available at `build/tests/test-client/client` and `build/tests/test-client/server` 120 | -------------------------------------------------------------------------------- /easy-socket.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2036 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "easy-socket", "easy-socket.vcxproj", "{EF42A18B-14CB-46AD-A34C-30B35EF0586C}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-client", "test\test-client\test-client.vcxproj", "{4FFDB01A-3314-4B28-841A-1FE8CE3516CE}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-server", "test\test-server\test-server.vcxproj", "{1CAD60FA-43FF-4595-84B3-B72ED7F3330F}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|x64 = Debug|x64 15 | Debug|x86 = Debug|x86 16 | Release|x64 = Release|x64 17 | Release|x86 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {EF42A18B-14CB-46AD-A34C-30B35EF0586C}.Debug|x64.ActiveCfg = Debug|x64 21 | {EF42A18B-14CB-46AD-A34C-30B35EF0586C}.Debug|x64.Build.0 = Debug|x64 22 | {EF42A18B-14CB-46AD-A34C-30B35EF0586C}.Debug|x86.ActiveCfg = Debug|Win32 23 | {EF42A18B-14CB-46AD-A34C-30B35EF0586C}.Debug|x86.Build.0 = Debug|Win32 24 | {EF42A18B-14CB-46AD-A34C-30B35EF0586C}.Release|x64.ActiveCfg = Release|x64 25 | {EF42A18B-14CB-46AD-A34C-30B35EF0586C}.Release|x64.Build.0 = Release|x64 26 | {EF42A18B-14CB-46AD-A34C-30B35EF0586C}.Release|x86.ActiveCfg = Release|Win32 27 | {EF42A18B-14CB-46AD-A34C-30B35EF0586C}.Release|x86.Build.0 = Release|Win32 28 | {4FFDB01A-3314-4B28-841A-1FE8CE3516CE}.Debug|x64.ActiveCfg = Debug|x64 29 | {4FFDB01A-3314-4B28-841A-1FE8CE3516CE}.Debug|x64.Build.0 = Debug|x64 30 | {4FFDB01A-3314-4B28-841A-1FE8CE3516CE}.Debug|x86.ActiveCfg = Debug|Win32 31 | {4FFDB01A-3314-4B28-841A-1FE8CE3516CE}.Debug|x86.Build.0 = Debug|Win32 32 | {4FFDB01A-3314-4B28-841A-1FE8CE3516CE}.Release|x64.ActiveCfg = Release|x64 33 | {4FFDB01A-3314-4B28-841A-1FE8CE3516CE}.Release|x64.Build.0 = Release|x64 34 | {4FFDB01A-3314-4B28-841A-1FE8CE3516CE}.Release|x86.ActiveCfg = Release|Win32 35 | {4FFDB01A-3314-4B28-841A-1FE8CE3516CE}.Release|x86.Build.0 = Release|Win32 36 | {1CAD60FA-43FF-4595-84B3-B72ED7F3330F}.Debug|x64.ActiveCfg = Debug|x64 37 | {1CAD60FA-43FF-4595-84B3-B72ED7F3330F}.Debug|x64.Build.0 = Debug|x64 38 | {1CAD60FA-43FF-4595-84B3-B72ED7F3330F}.Debug|x86.ActiveCfg = Debug|Win32 39 | {1CAD60FA-43FF-4595-84B3-B72ED7F3330F}.Debug|x86.Build.0 = Debug|Win32 40 | {1CAD60FA-43FF-4595-84B3-B72ED7F3330F}.Release|x64.ActiveCfg = Release|x64 41 | {1CAD60FA-43FF-4595-84B3-B72ED7F3330F}.Release|x64.Build.0 = Release|x64 42 | {1CAD60FA-43FF-4595-84B3-B72ED7F3330F}.Release|x86.ActiveCfg = Release|Win32 43 | {1CAD60FA-43FF-4595-84B3-B72ED7F3330F}.Release|x86.Build.0 = Release|Win32 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | GlobalSection(ExtensibilityGlobals) = postSolution 49 | SolutionGuid = {60E3DBCB-0529-4A87-A1B0-1A92424246CB} 50 | EndGlobalSection 51 | EndGlobal 52 | -------------------------------------------------------------------------------- /easy-socket.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 23 | 24 | 25 | 15.0 26 | {EF42A18B-14CB-46AD-A34C-30B35EF0586C} 27 | easysocket 28 | 10.0.17134.0 29 | 30 | 31 | 32 | Application 33 | true 34 | v141 35 | MultiByte 36 | 37 | 38 | Application 39 | false 40 | v141 41 | true 42 | MultiByte 43 | 44 | 45 | Application 46 | true 47 | v141 48 | MultiByte 49 | 50 | 51 | Application 52 | false 53 | v141 54 | true 55 | MultiByte 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | Level3 79 | Disabled 80 | true 81 | true 82 | 83 | 84 | ws2_32.lib;%(AdditionalDependencies) 85 | 86 | 87 | 88 | 89 | Level3 90 | Disabled 91 | true 92 | true 93 | 94 | 95 | ws2_32.lib;%(AdditionalDependencies) 96 | 97 | 98 | 99 | 100 | Level3 101 | MaxSpeed 102 | true 103 | true 104 | true 105 | true 106 | 107 | 108 | true 109 | true 110 | ws2_32.lib;%(AdditionalDependencies) 111 | 112 | 113 | 114 | 115 | Level3 116 | MaxSpeed 117 | true 118 | true 119 | true 120 | true 121 | 122 | 123 | true 124 | true 125 | ws2_32.lib;%(AdditionalDependencies) 126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /easy-socket.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {547e071a-a9a2-417c-8a96-de683b5c2282} 18 | 19 | 20 | 21 | 22 | Header Files\masesk 23 | 24 | 25 | -------------------------------------------------------------------------------- /include/masesk/EasySocket.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EASYSOCKET 2 | #define EASYSOCKET 3 | 4 | #ifdef _WIN32 5 | #include 6 | #include 7 | #else 8 | #include 9 | #include 10 | #include 11 | #include 12 | typedef int SOCKET; 13 | const int INVALID_SOCKET = 0; 14 | const int SOCKET_ERROR = -1; 15 | #endif 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | namespace masesk { 26 | const int BUFF_SIZE = 4096; 27 | struct socket_error_exception : public std::exception 28 | { 29 | const char * what() const throw () 30 | { 31 | return "Can't start socket!"; 32 | } 33 | }; 34 | struct invalid_socket_exception : public std::exception 35 | { 36 | const char * what() const throw () 37 | { 38 | return "Can't create a socket!"; 39 | } 40 | }; 41 | struct data_size_exception : public std::exception 42 | { 43 | const char * what() const throw () 44 | { 45 | return "Data size is above the maximum allowed by the buffer"; 46 | } 47 | }; 48 | class EasySocket { 49 | public: 50 | void socketListen(const std::string &channelName, int port, std::function callback) { 51 | 52 | if (sockInit() != 0) { 53 | throw masesk::socket_error_exception(); 54 | } 55 | SOCKET listening = socket(AF_INET, SOCK_STREAM, 0); 56 | if (listening == INVALID_SOCKET || listening == SOCKET_ERROR) 57 | { 58 | throw masesk::socket_error_exception(); 59 | } 60 | sockaddr_in hint; 61 | hint.sin_family = AF_INET; 62 | hint.sin_port = htons(port); 63 | #ifdef _WIN32 64 | hint.sin_addr.S_un.S_addr = INADDR_ANY; 65 | #else 66 | hint.sin_addr.s_addr = INADDR_ANY; 67 | #endif 68 | bind(listening, (sockaddr*)&hint, sizeof(hint)); 69 | listen(listening, SOMAXCONN); 70 | sockaddr_in client; 71 | #ifdef _WIN32 72 | int clientSize = sizeof(client); 73 | #else 74 | unsigned int clientSize = sizeof(client); 75 | #endif 76 | SOCKET clientSocket = accept(listening, (sockaddr*)&client, &clientSize); 77 | server_sockets[channelName] = clientSocket; 78 | char host[NI_MAXHOST]; 79 | char service[NI_MAXSERV]; 80 | 81 | memset(host, 0, NI_MAXHOST); 82 | memset(service, 0, NI_MAXSERV); 83 | if (getnameinfo((sockaddr*)&client, sizeof(client), host, NI_MAXHOST, service, NI_MAXSERV, 0) == 0) 84 | { 85 | std::cout << host << " connected on port " << service << std::endl; 86 | } 87 | else 88 | { 89 | inet_ntop(AF_INET, &client.sin_addr, host, NI_MAXHOST); 90 | std::cout << host << " connected on port " << 91 | ntohs(client.sin_port) << std::endl; 92 | } 93 | sockClose(listening); 94 | char buff[BUFF_SIZE]; 95 | while (true) 96 | { 97 | memset(buff, 0, BUFF_SIZE); 98 | 99 | int bytesReceived = recv(clientSocket, buff, BUFF_SIZE, 0); 100 | if (bytesReceived == SOCKET_ERROR) 101 | { 102 | throw socket_error_exception(); 103 | } 104 | if (bytesReceived > BUFF_SIZE) { 105 | throw masesk::data_size_exception(); 106 | } 107 | if (bytesReceived > 0) { 108 | callback(std::string(buff, 0, bytesReceived)); 109 | } 110 | else { 111 | break; 112 | } 113 | 114 | 115 | } 116 | sockClose(clientSocket); 117 | sockQuit(); 118 | } 119 | 120 | void socketSend(const std::string &channelName, const std::string &data) { 121 | if (data.size() > BUFF_SIZE) { 122 | throw masesk::data_size_exception(); 123 | } 124 | 125 | if (client_sockets.find(channelName) != client_sockets.end()) { 126 | SOCKET sock = client_sockets.at(channelName); 127 | int sendResult = send(sock, data.c_str(), data.size() + 1, 0); 128 | if (sendResult == SOCKET_ERROR) 129 | { 130 | throw masesk::socket_error_exception(); 131 | } 132 | } 133 | } 134 | 135 | void socketConnect(const std::string &channelName, const std::string &ip, std::uint16_t port) { 136 | if (sockInit() != 0) { 137 | throw masesk::socket_error_exception(); 138 | return; 139 | } 140 | SOCKET sock = socket(AF_INET, SOCK_STREAM, 0); 141 | if (sock == INVALID_SOCKET || sock == SOCKET_ERROR) 142 | { 143 | sockQuit(); 144 | throw masesk::socket_error_exception(); 145 | } 146 | sockaddr_in hint; 147 | hint.sin_family = AF_INET; 148 | hint.sin_port = htons(port); 149 | inet_pton(AF_INET, ip.c_str(), &hint.sin_addr); 150 | int connResult = connect(sock, (sockaddr*)&hint, sizeof(hint)); 151 | if (connResult == SOCKET_ERROR) 152 | { 153 | sockClose(sock); 154 | sockQuit(); 155 | throw socket_error_exception(); 156 | } 157 | client_sockets[channelName] = sock; 158 | 159 | } 160 | void closeConnection(const std::string &channelName) { 161 | if (client_sockets.find(channelName) != client_sockets.end()) { 162 | SOCKET s = client_sockets.at(channelName); 163 | sockClose(s); 164 | sockQuit(); 165 | } 166 | 167 | } 168 | private: 169 | 170 | std::unordered_map client_sockets; 171 | std::unordered_map server_sockets; 172 | int sockInit(void) 173 | { 174 | #ifdef _WIN32 175 | WSADATA wsa_data; 176 | return WSAStartup(MAKEWORD(1, 1), &wsa_data); 177 | #else 178 | return 0; 179 | #endif 180 | } 181 | 182 | int sockQuit(void) 183 | { 184 | #ifdef _WIN32 185 | return WSACleanup(); 186 | #else 187 | return 0; 188 | #endif 189 | } 190 | int sockClose(SOCKET sock) 191 | { 192 | 193 | int status = 0; 194 | 195 | #ifdef _WIN32 196 | status = shutdown(sock, SD_BOTH); 197 | if (status == 0) { status = closesocket(sock); } 198 | #else 199 | status = shutdown(sock, SHUT_RDWR); 200 | if (status == 0) { status = close(sock); } 201 | #endif 202 | 203 | return status; 204 | 205 | } 206 | }; 207 | } 208 | #endif -------------------------------------------------------------------------------- /test/test-client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( client 2 | Client.cpp 3 | ) 4 | 5 | target_link_libraries(client easy-socket) 6 | -------------------------------------------------------------------------------- /test/test-client/Client.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | using namespace masesk; 6 | 7 | int main() { 8 | EasySocket socketManager; 9 | socketManager.socketConnect("test", "127.0.0.1", 8080); 10 | string userInput; 11 | while (true) { 12 | cout << "> "; 13 | getline(cin, userInput); 14 | if (userInput.size() <= 0) { 15 | break; 16 | } 17 | socketManager.socketSend("test", userInput); 18 | } 19 | socketManager.closeConnection("test"); 20 | return 0; 21 | } -------------------------------------------------------------------------------- /test/test-client/test-client.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 15.0 23 | {4FFDB01A-3314-4B28-841A-1FE8CE3516CE} 24 | testclient 25 | 10.0.17134.0 26 | 27 | 28 | 29 | Application 30 | true 31 | v141 32 | MultiByte 33 | 34 | 35 | Application 36 | false 37 | v141 38 | true 39 | MultiByte 40 | 41 | 42 | Application 43 | true 44 | v141 45 | MultiByte 46 | 47 | 48 | Application 49 | false 50 | v141 51 | true 52 | MultiByte 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Level3 76 | Disabled 77 | true 78 | true 79 | $(SolutionDir)\include;%(AdditionalIncludeDirectories) 80 | 81 | 82 | ws2_32.lib;%(AdditionalDependencies) 83 | 84 | 85 | 86 | 87 | Level3 88 | Disabled 89 | true 90 | true 91 | $(SolutionDir)\include;%(AdditionalIncludeDirectories) 92 | 93 | 94 | ws2_32.lib;%(AdditionalDependencies) 95 | 96 | 97 | 98 | 99 | Level3 100 | MaxSpeed 101 | true 102 | true 103 | true 104 | true 105 | $(SolutionDir)\include;%(AdditionalIncludeDirectories) 106 | 107 | 108 | true 109 | true 110 | ws2_32.lib;%(AdditionalDependencies) 111 | 112 | 113 | 114 | 115 | Level3 116 | MaxSpeed 117 | true 118 | true 119 | true 120 | true 121 | $(SolutionDir)\include;%(AdditionalIncludeDirectories) 122 | 123 | 124 | true 125 | true 126 | ws2_32.lib;%(AdditionalDependencies) 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /test/test-client/test-client.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/test-server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( server 2 | Server.cpp 3 | ) 4 | 5 | target_link_libraries(server easy-socket) 6 | -------------------------------------------------------------------------------- /test/test-server/Server.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | using namespace masesk; 5 | 6 | void handleData(const std::string &data) { 7 | cout << "Client sent: " + data << endl; 8 | } 9 | 10 | int main() { 11 | EasySocket socketManager; 12 | socketManager.socketListen("test", 8080, &handleData); 13 | return 0; 14 | } -------------------------------------------------------------------------------- /test/test-server/test-server.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 15.0 23 | {1CAD60FA-43FF-4595-84B3-B72ED7F3330F} 24 | testserver 25 | 10.0.17134.0 26 | 27 | 28 | 29 | Application 30 | true 31 | v141 32 | MultiByte 33 | 34 | 35 | Application 36 | false 37 | v141 38 | true 39 | MultiByte 40 | 41 | 42 | Application 43 | true 44 | v141 45 | MultiByte 46 | 47 | 48 | Application 49 | false 50 | v141 51 | true 52 | MultiByte 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Level3 76 | Disabled 77 | true 78 | true 79 | $(SolutionDir)\include;%(AdditionalIncludeDirectories) 80 | 81 | 82 | ws2_32.lib;%(AdditionalDependencies) 83 | 84 | 85 | 86 | 87 | Level3 88 | Disabled 89 | true 90 | true 91 | $(SolutionDir)\include;%(AdditionalIncludeDirectories) 92 | 93 | 94 | ws2_32.lib;%(AdditionalDependencies) 95 | 96 | 97 | 98 | 99 | Level3 100 | MaxSpeed 101 | true 102 | true 103 | true 104 | true 105 | $(SolutionDir)\include;%(AdditionalIncludeDirectories) 106 | 107 | 108 | true 109 | true 110 | ws2_32.lib;%(AdditionalDependencies) 111 | 112 | 113 | 114 | 115 | Level3 116 | MaxSpeed 117 | true 118 | true 119 | true 120 | true 121 | $(SolutionDir)\include;%(AdditionalIncludeDirectories) 122 | 123 | 124 | true 125 | true 126 | ws2_32.lib;%(AdditionalDependencies) 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /test/test-server/test-server.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | --------------------------------------------------------------------------------