 
 		} while (!done);
 
-		return 0;
+		printf("SocketServer stopped!\n");
+		pthread_exit(0);
 	}
 
 	static void *SocketServer_thread(void *context) {

		if (sock != -1) {
			int result = shutdown(sock, SHUT_RDWR);
			if (result != 0) {
				fprintf(stderr, "problem shutting socket");
			}
			result = close(sock);
			if (result != 0) {
				fprintf(stderr, "problem closing socket");
			}
		}
	}

	void *runSocketServer() {

		bind(sock, (sockaddr*) &addr, sizeof(addr));
		listen(sock, 5);
		printf("SocketServer is running @ port %d ...\n", SERVER_SOCKET_PORT);

		do {
			sockaddr_in partnerAddr;
			int adrLen;
			int partnerSock = accept(sock, (sockaddr*) &partnerAddr,
					(socklen_t *) &adrLen);

			//HadoopUtils::FileInStream* inStream;
			//HadoopUtils::FileOutStream* outStream;

			//int32_t cmd;
			//cmd = HadoopUtils::deserializeInt(*inStream);

class SocketServer {
private:
	int sock;
	int port;
	bool done;

public:
	SocketServer() {
		sock = -1;
		port = -1;
		done = false;
	}

	~SocketServer() {
