コード例 #1
0
ファイル: Server.hpp プロジェクト: cygnuson/Card-Game-Of-26
	//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);
		}
	}
コード例 #2
0
ファイル: Server.hpp プロジェクト: cygnuson/Card-Game-Of-26
	//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;
			}
		}
	}