 
 	sleep(2);
 
-	host_client->sendDone();
+	socket_client.sendDone();
 	// wait for SocketServer
 	pthread_join(t_socket_server, NULL);
 

	return result;
}

__global__ void device_method(SocketClient *d_socket_client) {

	//d_socket_client

	//int val = d_object->getValue();
	//cuPrintf("Device object value: %d\n", val);
	//d_object->setValue(++val);
	//__threadfence();
}

int main(void) {

#include <cuda_runtime.h>

// Global vars
pthread_t t_socket_server;
SocketServer socket_server;
SocketClient socket_client;

class KernelWrapper {
private:
	MESSAGE_TYPE command;
	int param1;
	bool result_available;
	int resultInt;
	//string resultString;
public:
	int active_thread_id;

	KernelWrapper() {
		active_thread_id = -1;
		result_available = false;
	}
	~KernelWrapper() {
	}

	__device__ __host__ int getValue(int val) {

		command = GET_NEXT_VALUE;
		param1 = val;

		while (!result_available) {
		}

		//d_object->setValue(++val);
		//__threadfence();

		return resultInt;
	}

	__device__ __host__ void done() {
		command = DONE;
	}
};

void sigint_handler(int s) {
	printf("Caught signal %d\n", s);

	socket_client.sendDone();

	pthread_join(t_socket_server, NULL);
	exit(0);
