44 #include <boost/bind/bind.hpp>
79 std::string
md5sum, service, client_callerid;
81 || !
header.getValue(
"service", service)
82 || !
header.getValue(
"callerid", client_callerid))
84 std::string msg(
"bogus tcpros header. did not have the "
85 "required elements: md5sum, service, callerid");
93 std::string persistent;
94 if (
header.getValue(
"persistent", persistent))
96 if (persistent ==
"1" || persistent ==
"true")
102 ROSCPP_LOG_DEBUG(
"Service client [%s] wants service [%s] with md5sum [%s]", client_callerid.c_str(), service.c_str(),
md5sum.c_str());
106 std::string msg = std::string(
"received a tcpros connection for a "
107 "nonexistent service [") +
108 service + std::string(
"].");
115 if (ss->getMD5Sum() !=
md5sum &&
116 (
md5sum != std::string(
"*") && ss->getMD5Sum() != std::string(
"*")))
118 std::string msg = std::string(
"client wants service ") + service +
119 std::string(
" to have md5sum ") +
md5sum +
120 std::string(
", but it has ") + ss->getMD5Sum() +
121 std::string(
". Dropping connection.");
135 std::string msg = std::string(
"received a tcpros connection for a "
136 "nonexistent service [") +
137 service + std::string(
"].");
150 m[
"request_type"] = ss->getRequestDataType();
151 m[
"response_type"] = ss->getResponseDataType();
152 m[
"type"] = ss->getDataType();
153 m[
"md5sum"] = ss->getMD5Sum();
157 ss->addServiceClientLink(shared_from_this());
170 parent->removeServiceClientLink(shared_from_this());
189 uint32_t len = *((uint32_t*)buffer.get());
191 if (len > 1000000000)
193 ROS_ERROR(
"a message of over a gigabyte was " \
194 "predicted in tcpros. that seems highly " \
195 "unlikely, so I'll assume protocol " \
196 "synchronization is lost.");
214 parent->processRequest(buffer, size, shared_from_this());