Example #1
0
	//send the hint to the server that the connecting is about to be closed.
	inline void close(SOCKET socket){
		sendProtocolMessage(socket, PROTOCOLCODES::CLOSEME, 1);
		closesocket(socket);
		if (readList.sockExists(socket)){
			readList.popSocket(socket);
		}
	}
Example #2
0
	//send the hint to the server that the connecting is about to be closed.
	inline void closeAll(){
		for (const auto& e : readList.sockets){
			SOCKET socket = e.first;
			sendProtocolMessage(socket, PROTOCOLCODES::CLOSEME, 1);
			closesocket(socket);
			if (readList.sockExists(socket)){
				readList.popSocket(socket);
			}
			if (readList.sockets.size() == 0){
				break;
			}
		}
	}