29 #ifndef INFINISQLTRANSACTIONAGENT_H
30 #define INFINISQLTRANSACTIONAGENT_H
131 msgpack::sbuffer *
makeSbuf(msgpack::sbuffer *);
132 msgpack::sbuffer *
makeSbuf(vector<string> *);
133 msgpack::sbuffer *
makeSbuf(std::map<string, string> *);
374 template <
typename T>
377 msgpack::sbuffer *sbuf =
makeSbuf(response);
378 int64_t totalsize = 2*
sizeof(uint64_t) + sbuf->size();
380 uint64_t x = htobe64((uint64_t)totalsize);
381 memcpy(payload, &x,
sizeof(x));
382 x = htobe64((uint64_t)resultCode);
383 memcpy(payload +
sizeof(x), &x,
sizeof(x));
385 memcpy(payload+(2*
sizeof(x)), sbuf->data(), sbuf->size());
386 ssize_t totalwritten = write(
sockfd, payload, totalsize);
388 if (totalwritten == totalsize)
399 if (totalwritten == -1)
401 if (errno==EAGAIN || errno==EWOULDBLOCK)
404 sendLaterMap::iterator sendLaterIterator;
409 printf(
"%s %i endConnection\n", __FILE__, __LINE__);
423 struct epoll_event ev;
424 ev.events = EPOLLIN | EPOLLOUT | EPOLLHUP | EPOLLET;
428 printf(
"%s %i endConnection\n", __FILE__, __LINE__);
451 template <
typename T >
461 actor->mboxes.toActor(actor->myIdentity.address, dest, msg);
487 boost::unordered_map<int64_t, class Applier *>
Appliers;
489 boost::unordered_map<int, class Pg *>
Pgs;
501 boost::unordered_map< int64_t,
502 boost::unordered_map<std::string, class Statement> >
statements;
517 template <
typename T >
521 servent->msgsnd.data = (
void *)msg;
523 ((
class Message *)servent->msgsnd.data)->messageStruct.payloadtype =