Commit 8f211370 authored by jan.koester's avatar jan.koester
Browse files

Merge branch 'main' of git.tuxist.de:jan.koester/libnetplus

parents 05596668 6ae4097e
Loading
Loading
Loading
Loading
+11 −1
Changes for .kdev4/libnetplus.kdev4: 11 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x14\x00l\x00i\x00b\x00n\x00e\x00t\x00p\x00l\x00u\x00s)

[CMake]
Build Directory Count=1
Build Directory Count=2
Current Build Directory Index-Host System=0
Current Build Directory Index-Host-System=1

@@ -16,5 +16,15 @@ Extra Arguments=
Install Directory=
Runtime=Host System

[CMake][CMake Build Directory 1]
Build Directory Path=/home/intranet.tuxist.de/jan.koester/Projects/libnetplus/build
Build Type=Debug
CMake Binary=/usr/bin/cmake
CMake Executable=/usr/bin/cmake
Environment Profile=
Extra Arguments=
Install Directory=/usr/local
Runtime=Host-System

[Project]
VersionControlSupport=kdevgit
+1 −1
Changes for src/CMakeLists.txt: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include)
include(CMakePackageConfigHelpers)

configure_package_config_file(
    "${CMAKE_SOURCE_DIR}/libnetplusConfig.cmake.in"
    "${CMAKE_CURRENT_SOURCE_DIR}/../libnetplusConfig.cmake.in"
    "${CMAKE_BINARY_DIR}/libnetplusConfig.cmake"
    INSTALL_DESTINATION ${ConfigPackageLocation}
)
+19 −2
Changes for src/event/iocp.cpp: 19 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -54,6 +54,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define BLOCKSIZE 16384

namespace netplus {
      bool RUNNING=true;

      bool WINAPI ConsoleHandler(DWORD event) {
            switch (event) {
                case CTRL_C_EVENT:
                    RUNNING=false;
                    return TRUE;
                default:
                    return FALSE;
            }
        }

	enum IOState {
		IO_READ_STATE = 0,
@@ -204,7 +215,7 @@ namespace netplus {
	public:
		EventWorker(int tid, ULONG_PTR args, EventWorkerArgs* eargs) {

			for (;;) {
			for (RUNNING) {
				OVERLAPPED* pOverlapped = nullptr;
				ULONG_PTR   lpContext = 0;
				DWORD       dwBytesTransfered = 0;
@@ -302,6 +313,12 @@ namespace netplus {
		NetException exception;
		EventWorkerArgs eargs;

		if (!SetConsoleCtrlHandler(ConsoleHandler, true)) {
			NetException exp;
			exp[NetException::Critical] << "event: runEventloop couldn't create ConsoleHandler !";
			throw exp;
		}

		HANDLE iocp = CreateIoCompletionPort(INVALID_HANDLE_VALUE, nullptr, 0, 0);

		if (!iocp) {
@@ -367,7 +384,7 @@ namespace netplus {
			throw exp;
		}

		for (;;) {
		for (RUNNING) {
			// This is the correct blocking call. It waits for the g_hAcceptEvent to be signaled.
			DWORD dwResult = WSAWaitForMultipleEvents(1, &g_hAcceptEvent, FALSE, WSA_INFINITE, FALSE);