if (argc < 8)
if (argc < 9)
int main(int argc, char *argv[]) {	int mastersock, workersock;	struct sockaddr_in socketaddr;	int addrlen;	char buffer[1024];	char size[100];	char sname[32], uname[32], auth[32];	pthread_t ConnThread;	int rec;	int port, PoolThreads, TxnQSize, ArraySize;	if (argc < 8)	{		printf("usage: appServer <dbnodename> <username> <password> <port> <db_connection> <transaction queue size> <transaction array size>\n");		//printf("example: ./appServer 9999 10 50 20\n");		return -1;	}		strcpy(sname, argv[1]);	strcpy(uname, argv[2]);	strcpy(auth, argv[3]);	port = atoi(argv[4]);	PoolThreads=atoi(argv[5]);	TxnQSize=atoi(argv[6]);	ArraySize=atoi(argv[7]);	init_common();	/* create the threadpool. */	if (!init_thread_pool(PoolThreads, TxnQSize, sname, uname, auth))	{		LOG_ERROR_MESSAGE("InitThreadPool() failed with %d connection", PoolThreads);      		return -1;  	}	/* Initialize app_txn_array */	init_app_txn_array(&app_admin_confirm_array, ArraySize);	init_app_txn_array(&app_admin_request_array, ArraySize);	init_app_txn_array(&app_best_sellers_array, ArraySize);	init_app_txn_array(&app_buy_confirm_array, ArraySize);	init_app_txn_array(&app_buy_request_array, ArraySize);	init_app_txn_array(&app_home_array, ArraySize);	init_app_txn_array(&app_new_products_array, ArraySize);	init_app_txn_array(&app_order_display_array, ArraySize);	init_app_txn_array(&app_order_inquiry_array, ArraySize);	init_app_txn_array(&app_product_detail_array, ArraySize);	init_app_txn_array(&app_search_request_array, ArraySize);	init_app_txn_array(&app_search_results_array, ArraySize);	init_app_txn_array(&app_shopping_cart_array, ArraySize);        /* initialize TxnQ */	init_queue(&TxnQ, TxnQSize);#ifdef GET_TIME	timefp = fopen("time.log", "w");        if (timefp == NULL)        {                LOG_ERROR_MESSAGE("cannot open file time.log\n");                return -1;        }#endif	mastersock = _server_init_socket(port);	if (mastersock < 0)	{		LOG_ERROR_MESSAGE("init server master socket failed\n");		return -1;	}	printf("The server is active.	You may terminate it with Ctrl-C.\n");	while (1) {		addrlen = sizeof(socketaddr);		workersock = accept(mastersock, (struct sockaddr *)&socketaddr, (socklen_t *)&addrlen);		if (workersock < 0) {			LOG_ERROR_MESSAGE("accept couldn't open worker socket, errno %d", errno);		}		connectioncount++;		printf("%s, you are user %d\n", WELCOME, connectioncount);		if ((rec=pthread_create(&ConnThread, NULL, DoConnection, &workersock)) != 0)    		{			LOG_ERROR_MESSAGE("pthread_create failed, rec=%d", rec);			return -1;		}	}	printf("Shutting down.\n");	close(mastersock); 	return 0;}