Browse Source

第一次版本提交

master
panyufeng 4 years ago
parent
commit
08965250ae
59 changed files with 538 additions and 0 deletions
  1. BIN
      first_libevent/.vs/first_libevent/v15/.suo
  2. BIN
      first_libevent/.vs/first_libevent/v15/Browse.VC.db
  3. BIN
      first_libevent/.vs/first_libevent/v15/ipch/AutoPCH/4e457ba097f2ee00/FIRST_LIBEVENT.ipch
  4. BIN
      first_libevent/.vs/first_libevent/v15/ipch/AutoPCH/cd7cf78f7212760b/FIRST_LIBEVENT.ipch
  5. +23
    -0
      first_libevent/first_libevent.cpp
  6. +31
    -0
      first_libevent/first_libevent.sln
  7. +161
    -0
      first_libevent/first_libevent.vcxproj
  8. +22
    -0
      first_libevent/first_libevent.vcxproj.filters
  9. +4
    -0
      first_libevent/first_libevent.vcxproj.user
  10. BIN
      first_libevent/x64/Debug/first_libevent.exe
  11. BIN
      first_libevent/x64/Debug/first_libevent.ilk
  12. +2
    -0
      first_libevent/x64/Debug/first_libevent.log
  13. BIN
      first_libevent/x64/Debug/first_libevent.obj
  14. BIN
      first_libevent/x64/Debug/first_libevent.pdb
  15. BIN
      first_libevent/x64/Debug/first_libevent.tlog/CL.command.1.tlog
  16. BIN
      first_libevent/x64/Debug/first_libevent.tlog/CL.read.1.tlog
  17. BIN
      first_libevent/x64/Debug/first_libevent.tlog/CL.write.1.tlog
  18. +2
    -0
      first_libevent/x64/Debug/first_libevent.tlog/first_libevent.lastbuildstate
  19. BIN
      first_libevent/x64/Debug/first_libevent.tlog/link.command.1.tlog
  20. BIN
      first_libevent/x64/Debug/first_libevent.tlog/link.read.1.tlog
  21. BIN
      first_libevent/x64/Debug/first_libevent.tlog/link.write.1.tlog
  22. BIN
      first_libevent/x64/Debug/vc141.idb
  23. BIN
      first_libevent/x64/Debug/vc141.pdb
  24. BIN
      test_libevent/.vs/first_libevent/v15/.suo
  25. BIN
      test_libevent/.vs/first_libevent/v15/Browse.VC.db
  26. BIN
      test_libevent/.vs/first_libevent/v15/ipch/AutoPCH/4e457ba097f2ee00/FIRST_LIBEVENT.ipch
  27. BIN
      test_libevent/.vs/first_libevent/v15/ipch/AutoPCH/b4deb4dae1f7529b/FIRST_LIBEVENT.ipch
  28. BIN
      test_libevent/.vs/first_libevent/v15/ipch/AutoPCH/cd7cf78f7212760b/FIRST_LIBEVENT.ipch
  29. BIN
      test_libevent/.vs/first_libevent/v15/ipch/AutoPCH/d0ab54dfd30906af/TEST_LIBEVENT.ipch
  30. +31
    -0
      test_libevent/first_libevent.sln
  31. +162
    -0
      test_libevent/first_libevent.vcxproj
  32. +22
    -0
      test_libevent/first_libevent.vcxproj.filters
  33. +4
    -0
      test_libevent/first_libevent.vcxproj.user
  34. +67
    -0
      test_libevent/test_libevent.cpp
  35. BIN
      test_libevent/x64/Debug/first_libevent.exe
  36. BIN
      test_libevent/x64/Debug/first_libevent.ilk
  37. +3
    -0
      test_libevent/x64/Debug/first_libevent.log
  38. BIN
      test_libevent/x64/Debug/first_libevent.obj
  39. BIN
      test_libevent/x64/Debug/first_libevent.pdb
  40. BIN
      test_libevent/x64/Debug/first_libevent.tlog/CL.command.1.tlog
  41. BIN
      test_libevent/x64/Debug/first_libevent.tlog/CL.read.1.tlog
  42. BIN
      test_libevent/x64/Debug/first_libevent.tlog/CL.write.1.tlog
  43. +2
    -0
      test_libevent/x64/Debug/first_libevent.tlog/first_libevent.lastbuildstate
  44. BIN
      test_libevent/x64/Debug/first_libevent.tlog/link.command.1.tlog
  45. BIN
      test_libevent/x64/Debug/first_libevent.tlog/link.read.1.tlog
  46. BIN
      test_libevent/x64/Debug/first_libevent.tlog/link.write.1.tlog
  47. BIN
      test_libevent/x64/Debug/test_libevent.exe
  48. BIN
      test_libevent/x64/Debug/test_libevent.ilk
  49. BIN
      test_libevent/x64/Debug/test_libevent.obj
  50. BIN
      test_libevent/x64/Debug/test_libevent.pdb
  51. BIN
      test_libevent/x64/Debug/test_libevent.tlog/CL.command.1.tlog
  52. BIN
      test_libevent/x64/Debug/test_libevent.tlog/CL.read.1.tlog
  53. BIN
      test_libevent/x64/Debug/test_libevent.tlog/CL.write.1.tlog
  54. BIN
      test_libevent/x64/Debug/test_libevent.tlog/link.command.1.tlog
  55. BIN
      test_libevent/x64/Debug/test_libevent.tlog/link.read.1.tlog
  56. BIN
      test_libevent/x64/Debug/test_libevent.tlog/link.write.1.tlog
  57. +2
    -0
      test_libevent/x64/Debug/test_libevent.tlog/test_libevent.lastbuildstate
  58. BIN
      test_libevent/x64/Debug/vc141.idb
  59. BIN
      test_libevent/x64/Debug/vc141.pdb

BIN
first_libevent/.vs/first_libevent/v15/.suo View File


BIN
first_libevent/.vs/first_libevent/v15/Browse.VC.db View File


BIN
first_libevent/.vs/first_libevent/v15/ipch/AutoPCH/4e457ba097f2ee00/FIRST_LIBEVENT.ipch View File


BIN
first_libevent/.vs/first_libevent/v15/ipch/AutoPCH/cd7cf78f7212760b/FIRST_LIBEVENT.ipch View File


+ 23
- 0
first_libevent/first_libevent.cpp View File

@ -0,0 +1,23 @@

#include <iostream>
#include<event2/event.h>
int main()
{
#ifdef _WIN32
//初始化socket库
WSADATA wsa;
WSAStartup(MAKEWORD(2, 2), &wsa);
#endif
std::cout << "test libevent!\n";
//创建libevent上下文
event_base* base = event_base_new();
if (base) {
std::cout << "yes";
}
return 0;
}

+ 31
- 0
first_libevent/first_libevent.sln View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1525
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "first_libevent", "first_libevent.vcxproj", "{129BF326-BFEE-4F1C-920C-0C302BB84895}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Debug|x64.ActiveCfg = Debug|x64
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Debug|x64.Build.0 = Debug|x64
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Debug|x86.ActiveCfg = Debug|Win32
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Debug|x86.Build.0 = Debug|Win32
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Release|x64.ActiveCfg = Release|x64
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Release|x64.Build.0 = Release|x64
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Release|x86.ActiveCfg = Release|Win32
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {191D7F93-7554-493B-92E1-BB302C5A8383}
EndGlobalSection
EndGlobal

+ 161
- 0
first_libevent/first_libevent.vcxproj View File

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{129BF326-BFEE-4F1C-920C-0C302BB84895}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>firstlibevent</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>libevent.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="first_libevent.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

+ 22
- 0
first_libevent/first_libevent.vcxproj.filters View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="first_libevent.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>

+ 4
- 0
first_libevent/first_libevent.vcxproj.user View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

BIN
first_libevent/x64/Debug/first_libevent.exe View File


BIN
first_libevent/x64/Debug/first_libevent.ilk View File


+ 2
- 0
first_libevent/x64/Debug/first_libevent.log View File

@ -0,0 +1,2 @@
 first_libevent.cpp
first_libevent.vcxproj -> D:\c++\lib\libevent\src\first_libevent\x64\Debug\first_libevent.exe

BIN
first_libevent/x64/Debug/first_libevent.obj View File


BIN
first_libevent/x64/Debug/first_libevent.pdb View File


BIN
first_libevent/x64/Debug/first_libevent.tlog/CL.command.1.tlog View File


BIN
first_libevent/x64/Debug/first_libevent.tlog/CL.read.1.tlog View File


BIN
first_libevent/x64/Debug/first_libevent.tlog/CL.write.1.tlog View File


+ 2
- 0
first_libevent/x64/Debug/first_libevent.tlog/first_libevent.lastbuildstate View File

@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
Debug|x64|D:\c++\lib\libevent\src\first_libevent\|

BIN
first_libevent/x64/Debug/first_libevent.tlog/link.command.1.tlog View File


BIN
first_libevent/x64/Debug/first_libevent.tlog/link.read.1.tlog View File


BIN
first_libevent/x64/Debug/first_libevent.tlog/link.write.1.tlog View File


BIN
first_libevent/x64/Debug/vc141.idb View File


BIN
first_libevent/x64/Debug/vc141.pdb View File


BIN
test_libevent/.vs/first_libevent/v15/.suo View File


BIN
test_libevent/.vs/first_libevent/v15/Browse.VC.db View File


BIN
test_libevent/.vs/first_libevent/v15/ipch/AutoPCH/4e457ba097f2ee00/FIRST_LIBEVENT.ipch View File


BIN
test_libevent/.vs/first_libevent/v15/ipch/AutoPCH/b4deb4dae1f7529b/FIRST_LIBEVENT.ipch View File


BIN
test_libevent/.vs/first_libevent/v15/ipch/AutoPCH/cd7cf78f7212760b/FIRST_LIBEVENT.ipch View File


BIN
test_libevent/.vs/first_libevent/v15/ipch/AutoPCH/d0ab54dfd30906af/TEST_LIBEVENT.ipch View File


+ 31
- 0
test_libevent/first_libevent.sln View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1525
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "first_libevent", "first_libevent.vcxproj", "{129BF326-BFEE-4F1C-920C-0C302BB84895}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Debug|x64.ActiveCfg = Debug|x64
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Debug|x64.Build.0 = Debug|x64
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Debug|x86.ActiveCfg = Debug|Win32
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Debug|x86.Build.0 = Debug|Win32
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Release|x64.ActiveCfg = Release|x64
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Release|x64.Build.0 = Release|x64
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Release|x86.ActiveCfg = Release|Win32
{129BF326-BFEE-4F1C-920C-0C302BB84895}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {191D7F93-7554-493B-92E1-BB302C5A8383}
EndGlobalSection
EndGlobal

+ 162
- 0
test_libevent/first_libevent.vcxproj View File

@ -0,0 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{129BF326-BFEE-4F1C-920C-0C302BB84895}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>firstlibevent</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<ProjectName>test_libevent</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>libevent.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="test_libevent.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

+ 22
- 0
test_libevent/first_libevent.vcxproj.filters View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="test_libevent.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>

+ 4
- 0
test_libevent/first_libevent.vcxproj.user View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

+ 67
- 0
test_libevent/test_libevent.cpp View File

@ -0,0 +1,67 @@

#include <iostream>
#include<event2/event.h>
#include <event2/listener.h>
#include <string.h>
#ifndef _WIN32
#include <signal.h>
#endif // !_WIN32
#define SPORT 5001
void listen_cb(struct evconnlistener *, evutil_socket_t, struct sockaddr *, int socklen, void *arg) {
std::cout << "listen to be" << std::endl;
}
int main()
{
#ifdef _WIN32
//初始化socket库
WSADATA wsa;
WSAStartup(MAKEWORD(2, 2), &wsa);
#else
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { //忽略管道信号,发送数据给已关闭的socket,会飞掉!
return 1;
}
#endif
//创建libevent上下文
event_base* base = event_base_new();
if (base) {
std::cout << "test server" << "\n";
}
sockaddr_in sin;
memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_port = htons(SPORT);
//socket,bind listen 绑定事件
evconnlistener * ev = evconnlistener_new_bind(base, //libevent上下文
listen_cb, //接收到连接的回调函数
base, //回调函数获取的参数(根据业务来)
LEV_OPT_REUSEABLE | LEV_OPT_CLOSE_ON_FREE, //地址重用,evconnlistener关闭同时关闭socket
10, //连接队列大小,对应listen函数参数
(sockaddr*)&sin,//绑定的地址和端口
sizeof(sin)
);
if (base)
event_base_dispatch(base); //事件分发处理
if (ev)
evconnlistener_free(ev); //清理
if (base)
event_base_free(base);
#if _WIN32
WSACleanup();
#endif // _WIN32
return 0;
}

BIN
test_libevent/x64/Debug/first_libevent.exe View File


BIN
test_libevent/x64/Debug/first_libevent.ilk View File


+ 3
- 0
test_libevent/x64/Debug/first_libevent.log View File

@ -0,0 +1,3 @@
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(391,5): warning MSB8028: 中间目录(x64\Debug\)包含从另一个项目(first_libevent.vcxproj)共享的文件。 这会导致错误的清除和重新生成行为。
test_libevent.cpp
first_libevent.vcxproj -> D:\c++\lib\libevent\src\test_libevent\x64\Debug\test_libevent.exe

BIN
test_libevent/x64/Debug/first_libevent.obj View File


BIN
test_libevent/x64/Debug/first_libevent.pdb View File


BIN
test_libevent/x64/Debug/first_libevent.tlog/CL.command.1.tlog View File


BIN
test_libevent/x64/Debug/first_libevent.tlog/CL.read.1.tlog View File


BIN
test_libevent/x64/Debug/first_libevent.tlog/CL.write.1.tlog View File


+ 2
- 0
test_libevent/x64/Debug/first_libevent.tlog/first_libevent.lastbuildstate View File

@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
Debug|x64|D:\c++\lib\libevent\src\first_libevent\|

BIN
test_libevent/x64/Debug/first_libevent.tlog/link.command.1.tlog View File


BIN
test_libevent/x64/Debug/first_libevent.tlog/link.read.1.tlog View File


BIN
test_libevent/x64/Debug/first_libevent.tlog/link.write.1.tlog View File


BIN
test_libevent/x64/Debug/test_libevent.exe View File


BIN
test_libevent/x64/Debug/test_libevent.ilk View File


BIN
test_libevent/x64/Debug/test_libevent.obj View File


BIN
test_libevent/x64/Debug/test_libevent.pdb View File


BIN
test_libevent/x64/Debug/test_libevent.tlog/CL.command.1.tlog View File


BIN
test_libevent/x64/Debug/test_libevent.tlog/CL.read.1.tlog View File


BIN
test_libevent/x64/Debug/test_libevent.tlog/CL.write.1.tlog View File


BIN
test_libevent/x64/Debug/test_libevent.tlog/link.command.1.tlog View File


BIN
test_libevent/x64/Debug/test_libevent.tlog/link.read.1.tlog View File


BIN
test_libevent/x64/Debug/test_libevent.tlog/link.write.1.tlog View File


+ 2
- 0
test_libevent/x64/Debug/test_libevent.tlog/test_libevent.lastbuildstate View File

@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
Debug|x64|D:\c++\lib\libevent\src\test_libevent\|

BIN
test_libevent/x64/Debug/vc141.idb View File


BIN
test_libevent/x64/Debug/vc141.pdb View File


Loading…
Cancel
Save