// LogServerNative.cpp : Defines the exported functions for the DLL application.
//

#include "stdafx.h"
#include "LogServer.h"

namespace smackbio{
	namespace logserver{
		extern "C" {

			LogServer* __stdcall create_log_server(OnMessageCallback cb, void* ctx, int port, unsigned char enable_v6)
			{
				try
				{
					auto p = new LogServer(cb, ctx, port, enable_v6 != 0);
					return p;
				}
				catch (std::exception&)
				{
					return nullptr;
				}
			}

			void __stdcall stop_log_server(LogServer* p)
			{
				delete p;
			}
		}
	}
}
