Started VoidNet
This commit is contained in:
28
VoidNet/VoidNet.sln
Normal file
28
VoidNet/VoidNet.sln
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.24720.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VoidNet", "VoidNet\VoidNet.vcxproj", "{DC4D9247-92B6-4C52-B47C-41C34CF5D611}"
|
||||
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
|
||||
{DC4D9247-92B6-4C52-B47C-41C34CF5D611}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DC4D9247-92B6-4C52-B47C-41C34CF5D611}.Debug|x64.Build.0 = Debug|x64
|
||||
{DC4D9247-92B6-4C52-B47C-41C34CF5D611}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{DC4D9247-92B6-4C52-B47C-41C34CF5D611}.Debug|x86.Build.0 = Debug|Win32
|
||||
{DC4D9247-92B6-4C52-B47C-41C34CF5D611}.Release|x64.ActiveCfg = Release|x64
|
||||
{DC4D9247-92B6-4C52-B47C-41C34CF5D611}.Release|x64.Build.0 = Release|x64
|
||||
{DC4D9247-92B6-4C52-B47C-41C34CF5D611}.Release|x86.ActiveCfg = Release|Win32
|
||||
{DC4D9247-92B6-4C52-B47C-41C34CF5D611}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
45
VoidNet/VoidNet/Connection.cpp
Normal file
45
VoidNet/VoidNet/Connection.cpp
Normal file
@ -0,0 +1,45 @@
|
||||
#include "Connection.h"
|
||||
|
||||
VoidNet::Connection::Connection()
|
||||
{
|
||||
}
|
||||
|
||||
VoidNet::Connection::Connection(std::string IPAddress, unsigned int PortNumber) :
|
||||
IPAddress(IPAddress), PortNumber(PortNumber)
|
||||
{
|
||||
}
|
||||
|
||||
VoidNet::Connection::~Connection()
|
||||
{
|
||||
delete socket;
|
||||
}
|
||||
|
||||
VoidNet::Connection &VoidNet::Connection::operator=(const Connection &con)
|
||||
{
|
||||
return (VoidNet::Connection)con;
|
||||
|
||||
VoidNet::Connection asd;
|
||||
VoidNet::Connection dsa;
|
||||
}
|
||||
|
||||
bool VoidNet::Connection::operator==(Connection &con)
|
||||
{
|
||||
//return socket == con.socket;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VoidNet::Connection::operator!=(Connection &con)
|
||||
{
|
||||
//return socket != con.socket;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string VoidNet::Connection::getIPAddress()
|
||||
{
|
||||
return IPAddress;
|
||||
}
|
||||
|
||||
unsigned int VoidNet::Connection::getPortNumber()
|
||||
{
|
||||
return PortNumber;
|
||||
}
|
||||
45
VoidNet/VoidNet/Connection.h
Normal file
45
VoidNet/VoidNet/Connection.h
Normal file
@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include <Windows.h>
|
||||
#include <WinSock2.h>
|
||||
#include <string>
|
||||
|
||||
namespace VoidNet
|
||||
{
|
||||
struct Connection
|
||||
{
|
||||
// Default constructor
|
||||
Connection();
|
||||
|
||||
// Using this constructor will connect automatically
|
||||
// PortNumber grater than 0
|
||||
// IPAddress cant be null
|
||||
Connection(std::string, unsigned int);
|
||||
|
||||
// Destructor
|
||||
~Connection();
|
||||
|
||||
// Assignment operator
|
||||
VoidNet::Connection &operator = (const Connection&);
|
||||
bool operator == (Connection&);
|
||||
bool operator != (Connection&);
|
||||
|
||||
// this will return the IPAddress of the client connected
|
||||
std::string getIPAddress();
|
||||
|
||||
// this will return the Port Number of the client connected
|
||||
unsigned int getPortNumber();
|
||||
|
||||
|
||||
|
||||
private:
|
||||
// connection socket
|
||||
SOCKET *socket;
|
||||
|
||||
// client ip address
|
||||
std::string IPAddress;
|
||||
|
||||
// client port
|
||||
unsigned int PortNumber;
|
||||
};
|
||||
}
|
||||
BIN
VoidNet/VoidNet/Debug/vc140.idb
Normal file
BIN
VoidNet/VoidNet/Debug/vc140.idb
Normal file
Binary file not shown.
10
VoidNet/VoidNet/Enums.h
Normal file
10
VoidNet/VoidNet/Enums.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
namespace VoidNet
|
||||
{
|
||||
enum Protocol
|
||||
{
|
||||
TCP,
|
||||
UDP
|
||||
};
|
||||
}
|
||||
122
VoidNet/VoidNet/VoidNet.vcxproj
Normal file
122
VoidNet/VoidNet/VoidNet.vcxproj
Normal file
@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.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">
|
||||
<ProjectGuid>{DC4D9247-92B6-4C52-B47C-41C34CF5D611}</ProjectGuid>
|
||||
<RootNamespace>VoidNet</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</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 />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Connection.h" />
|
||||
<ClInclude Include="Enums.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Connection.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
30
VoidNet/VoidNet/VoidNet.vcxproj.filters
Normal file
30
VoidNet/VoidNet/VoidNet.vcxproj.filters
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<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>
|
||||
<ClInclude Include="Connection.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Enums.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Connection.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user