updated pluging loader for Windows #4313

This commit is contained in:
XinyuHou 2015-01-09 13:46:35 +00:00
parent de8fe7e2a5
commit 1d7eb3f5cb
12 changed files with 180 additions and 48 deletions

View file

@ -17,21 +17,41 @@
#include "ns.h"
#include "SecureSocket.h"
#include <iostream>
SecureSocket* g_secureSocket = NULL;
extern "C" {
int
init(void (*sendEvent)(const char*, void*), void (*log)(const char*))
{
std::cout << "hello world" << std::endl;
return 0;
}
void*
invoke(const char* command, void* args)
{
if (strcmp(command, "getSecureSocket") == 0) {
if (g_secureSocket == NULL) {
g_secureSocket = new SecureSocket();
}
return g_secureSocket;
}
else {
return NULL;
}
}
int
cleanup()
{
std::cout << "goodbye world" << std::endl;
if (g_secureSocket != NULL) {
delete g_secureSocket;
}
return 0;
}