コード例 #1
0
ファイル: Root.cpp プロジェクト: worldforge/atlas-cpp
void RootData::sendContents(Bridge & b) const
{
    sendId(b);
    sendParent(b);
    sendStamp(b);
    sendObjtype(b);
    sendName(b);
    BaseObjectData::sendContents(b);
}
コード例 #2
0
void peano::integration::dataqueries::CartesianGridWriterProxy::releaseMessages() {
#ifdef Parallel
  if(_positionList.size()>0){
      sendId(&_id);
      sendDataArray(&_positionList[0],_positionList.size());
      sendDataArray(_data,_recordsPerEntry*(_positionList.size()/3));
      _positionList.clear();
  }
#endif
}
コード例 #3
0
ファイル: rt_neth.c プロジェクト: Strongc/proview
static void
connectNode (
  gdb_sNode	*np
)
{

  gdb_AssumeUnlocked;

  if (!np->flags.b.connected) {
    errh_Info("Connected, link to %s (%s)",
      np->name, cdh_NodeIdToString(NULL, np->nid, 0, 0));

    sendId(np);

    np->flags.b.connected = 1;
    np->flags.b.active = 1;
  }

}
コード例 #4
0
/**
 * @brief handle_client handle a robot during his connection
 * @param passedClient the socket member
 */
void* handle_robot(void* passedClient) {
	struct ClientIdPair clientIdPaire = *(struct ClientIdPair*) passedClient;
	sendId(clientIdPaire.client, clientIdPaire.id);
	char message[MESSAGE_SIZE];
	Activity activity;
	while (true) {
		IOresult result = read(clientIdPaire.client,message,MESSAGE_SIZE);
		if (result == READ_FAILED)
			break;
		if (result == READ_FAILED || result == CONNECTION_FINISHED)
			break;
		printf("message received : %s\n",message);
		activity = message[1];
		printf("translated to : id = %u; tpm = %u -> activity = %u;\n",
				message[0], message[1], activity);
		setEtat(clientIdPaire.id,activity);
	}
	close(clientIdPaire.client);
	return 0;
}
コード例 #5
0
ファイル: TcpServer.cpp プロジェクト: wosiu/eognisko
void TcpServer::acceptClient() {
	acceptor_.async_accept(socket_, [this](boost::system::error_code ec)
	{
		if (!ec) {
			if ( controller.clients.size() > controller.MAX_CLIENT_NO ) {
				socket_.close(ec);
				if (!ec) {
					WARN("Client disconnected by server - too much clients.");
				} else {
					ERR(ec);
				}
			} else {
				// dodaje kleinta, zwraca referencje na kontekst z nim zwiazany
				auto cc = controller.addClient(std::move(socket_));
				sendId(cc);
				INFO("Client joined, sending id: " + _(cc->getId()) );
			}
		} else {
			ERR(ec);
		}

		acceptClient();
	});
}