21 #ifndef KINETIC_CPP_CLIENT_NONBLOCKING_PACKET_SERVICE_H_
22 #define KINETIC_CPP_CLIENT_NONBLOCKING_PACKET_SERVICE_H_
24 #include <sys/select.h>
28 #include <unordered_map>
29 #include <glog/logging.h>
31 #include "gmock/gmock.h"
33 #include "kinetic/nonblocking_packet_service_interface.h"
34 #include "kinetic/connection_options.h"
35 #include "kinetic/hmac_provider.h"
36 #include "kinetic_client.pb.h"
37 #include "nonblocking_packet.h"
38 #include "socket_wrapper_interface.h"
39 #include "nonblocking_packet_receiver.h"
40 #include "nonblocking_packet_sender.h"
43 using com::seagate::kinetic::client::proto::Message;
44 using com::seagate::kinetic::client::proto::Command;
45 using com::seagate::kinetic::client::proto::Command_Status_StatusCode;
48 using std::unique_ptr;
51 using std::unordered_map;
56 unique_ptr<NonblockingSenderInterface> sender,
57 shared_ptr<NonblockingReceiverInterface> receiver);
60 HandlerKey Submit(unique_ptr<Message> message, unique_ptr<Command> command,
const shared_ptr<const string> value,
61 unique_ptr<HandlerInterface> handler);
62 bool Run(fd_set *read_fds, fd_set *write_fds,
int *nfds);
63 bool Remove(HandlerKey handler_key);
66 shared_ptr<SocketWrapperInterface> socket_wrapper_;
67 unique_ptr<NonblockingSenderInterface> sender_;
68 shared_ptr<NonblockingReceiverInterface> receiver_;
77 #endif // KINETIC_CPP_CLIENT_NONBLOCKING_PACKET_SERVICE_H_