39 from __future__
import print_function
41 PKG =
'rospy_tutorials' 42 NAME =
'test_server_connection_header' 54 super(TestServerConnectionHeader, self).
__init__(*args)
56 rospy.init_node(NAME, anonymous=
True)
57 s = rospy.Service(
'add_two_ints_header_test', AddTwoInts, self.
handle_request)
60 if 'cookies' in req._connection_header:
61 print(
"GOT", req._connection_header[
'cookies'])
62 self.
success = req._connection_header[
'cookies'] ==
'peanut butter' 63 return AddTwoIntsResponse(3)
66 timeout_t = time.time() + 10.0*1000
67 while not rospy.is_shutdown()
and not self.
success and time.time() < timeout_t:
71 if __name__ ==
'__main__':
72 rostest.rosrun(PKG, NAME, TestServerConnectionHeader, sys.argv)