Client connect to server problem using winsock TCP c++ : I try to make a application that client send a message and the server respond on the same machine using winsock TCP c++. The problem is that after the server waited for client to connect, I ran the client code and it stopped at the accept and exit. This is my code.
Server:

    #include <stdio.h>
    #include <tchar.h>
    #include <winsock2.h>
    #include <iostream>
    
    #define MY_PORT 8888
    
    using namespace std;
    
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	//Init Winsock
    	WSADATA SData;
    	
    	if (WSAStartup(0x0202, &SData) != 0)
    	{
    		cout << "KHONG THE KHOI DONG WINSOCK";
    		return 1;
    	}
    
    	//Init Socket
    	int listeningSocket;
    	if ((listeningSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
    	{
    		perror("socket failed");
    		WSACleanup();
    		exit(EXIT_FAILURE);
    	}
    
    	//Set IP and PORT
    	sockaddr_in server_addr;
    
    	server_addr.sin_family = AF_INET;
    	server_addr.sin_port = htons(MY_PORT);
    	server_addr.sin_addr.s_addr = INADDR_ANY;
    
    	//Bind
    	if (bind(listeningSocket, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0)
    	{
    		perror("bind failed");
    		closesocket(listeningSocket);
    		WSACleanup();
    		exit(EXIT_FAILURE);
    	}
    
    	//Listen
    	if (listen(listeningSocket, 5) < 0)
    	{
    		perror("listen failed");
    		closesocket(listeningSocket);
    		WSACleanup();
    		exit(EXIT_FAILURE);
    	}
    
    	//Accept
    	int new_socket;
    	sockaddr_in client_addr;
    
    	int nSizeAddr = sizeof(sockaddr);
    	if (new_socket = accept(listeningSocket, (struct sockaddr *)&client_addr, &nSizeAddr) < 0)
    	{
    		perror("accept failed");
    		closesocket(listeningSocket);
    		WSACleanup();
    		exit(EXIT_FAILURE);
    	}
    
    	while (1)
    	{
    		//recv
    		char buff[100];
    		if (recv(new_socket, buff, 100, 0) < 0)
    		{
    			perror("recv failed");
    			closesocket(listeningSocket);
    			WSACleanup();
    			exit(EXIT_FAILURE);
    		}
    		cout << buff << endl;
    
    		//send
    		string sndStr = "Da nhan";
    		if (send(new_socket, sndStr.c_str(), sndStr.size(), 0) < 0)
    		{
    			perror("send failed");
    			closesocket(listeningSocket);
    			WSACleanup();
    			exit(EXIT_FAILURE);
    		}
    
    	}
    	//close socket
    	closesocket(new_socket);
    
    	//Cleanup winsock
    	WSACleanup();
    
    	return 0;
    }
Client:

    #include <stdio.h>
    #include <tchar.h>
    #include <winsock2.h>
    #include <iostream>
    #include <string>
    
    #define MY_PORT 8888
    
    using namespace std;
    
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	//Init winsock
    	WSADATA SData;
    	
    	if (WSAStartup(0x0202, &SData) != 0) 
    	{
    		cout << "KHONG THE KHOI DONG WINSOCK";
    		return 1;
    	}
    	//Init socket
    	int clientSocket;
    	if (clientSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) < 0)
    	{
    		perror("socket failed");
    		WSACleanup();
    		exit(EXIT_FAILURE);
    	}
    
    	//Set IP and PORT
    	sockaddr_in server_addr;
    
    	server_addr.sin_family = AF_INET;
    	server_addr.sin_port = htons(MY_PORT);
    	server_addr.sin_addr.s_addr = INADDR_ANY; //Vi Client-Server chung 1 may
    
    	//Connect
    	if (connect(clientSocket, (SOCKADDR*)&server_addr, sizeof(server_addr)) < 0)
    	{
    		perror("connect failed");
    		closesocket(clientSocket);
    		WSACleanup();
    		exit(EXIT_FAILURE);
    	}
    
    	while (1)
    	{
    		//Send 
    		string sndStr;
    		getline(cin, sndStr);
    		if (send(clientSocket, sndStr.c_str(), sndStr.size(), 0) < 0)
    		{
    			perror("send failed");
    			closesocket(clientSocket);
    			WSACleanup();
    			exit(EXIT_FAILURE);
    		}
    		//Recv
    		char buff[100];
    		if (recv(clientSocket, buff, 100, 0) < 0)
    		{
    			perror("recv failed");
    			closesocket(clientSocket);
    			WSACleanup();
    			exit(EXIT_FAILURE);
    		}
    		cout << buff << endl;
    	}
    	//Close socket
    	closesocket(clientSocket);
    
    	//Cleanup Winsock
    	WSACleanup();
    }
It had an error at the accept step but I don't know what was the error name. How can I fix it. 
Thanks for all your help