when i send it will show "Resource temporarily unavailable"
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- networking
Research direction
Start by reproducing the req/resp example with the shown Reqer.send, Reqer.recv, Resp.recv, and Resp.send calls, noting the libzmq version and Windows/Ubuntu setup. Check the return behavior around the reported error and whether the blocking flags match the observed calls. Done means determining whether this is a cppzmq binding bug or an issue in the example, with a minimal reproducible case.
Written by the indexing model from the issue text.
Description
Hello. i'm using req/resp.
Env
it works on windows10 (req) & Ubuntu Port Binoic (Resp) (armv8)
the same code is worked on yesterday .but now it does not work.
,the zppzmq version is same 425
Problem
when i send ,it return "Resource temporarily unavailable"
all device
Code
protobuf script
https://paste.ubuntu.org.cn/4545606
Req
zmq::context_t context(1);
zmq::socket_t Reqer(context, zmq::socket_type::req);
void NetServer::TNetStart(u_short *port)
{
//CLog netlog = Settings::GetInstance()->Logger_NetWork;
auto Req
= std::make_shared<NetMsg::ReqHeader>();
auto Cor
= std::make_shared<NetMsg::PubSub_Coordinate>();
//spy all events
std::cout << std::get<0>(zmq::version()) << std::endl;
std::cout << std::get<1>(zmq::version()) << std::endl;
std::cout << std::get<2>(zmq::version()) << std::endl;
// netlog.printf("[%s:%d]NetServer::TNetStart zmq->subscriber", __FILE__, __LINE__);
//netlog.printf("binding local 1025");
try
{
Reqer.connect("tcp://192.168.191.2:1025");
}
catch (const std::exception& e)
{
// the connect is successful
std::cout << "err:" << e.what() << std::endl;
}
//netlog.printf("connecting remote tcp://192.168.191.2:1025");
// netlog.printf("waiting info (loop)");
while (true)
{
zmq::message_t recvmessage;
zmq::message_t sendmessage;
// this is protobuf .i thought it is good
Req->set_cmd_code(0);
Req->set_cmd_dat_len(0);
Req->set_cmd_type(NetMsg::MsgType::Dat);
sendmessage.rebuild(Req->ByteSizeLong());
Req->SerializeToArray(sendmessage.data(), sendmessage.size());
Reqer.send(sendmessage, zmq::send_flags::none);// it print "Resource temporarily unavailable"!!!!!!!!!!!!!!!!
Reqer.recv(recvmessage, zmq::recv_flags::none);
Cor->ParseFromArray(recvmessage.data(), recvmessage.size());
Settings::GetInstance()->SetRobotAtt(Robot1, Cor->ix(), Cor->iy(), Cor->iyaw());
Sleep(1);
}
}
resp
// it works on a non-blocking thread
void NetDispatch()
{
auto pReqHeader
= std::make_shared<NetMsg::ReqHeader>();
auto pCorInfo = std::make_shared<NetMsg::PubSub_Coordinate>();
std::cout << "bind 1025\r\n" ;
Resp.bind("tcp://*:1025");
std::cout << std::get<0>(zmq::version()) << std::endl;
std::cout << std::get<1>(zmq::version()) << std::endl;
std::cout << std::get<2>(zmq::version()) << std::endl;
while(true)
{
zmq::message_t recvmsg;
std::cout << "waiting \r\n" ;
Resp.recv(&recvmsg);
printf("%s\r\n",zmq_strerror(zmq_errno()));// it print "Resource temporarily unavailable"!!!!!!!!!!!!!!!!
std::cout << "recv \r\n" ;
pReqHeader->ParseFromArray(recvmsg.data(),recvmsg.size());
//pReqHeader->PrintDebugString();
pCorInfo->set_ix(g_Pose.iX);
pCorInfo->set_iy(g_Pose.iY);
pCorInfo->set_iyaw(g_Pose.iYaw/10.f);
//pCorInfo->PrintDebugString();
zmq::message_t message(pCorInfo->ByteSizeLong());
pCorInfo->SerializeToArray(message.data(),pCorInfo->ByteSizeLong());
pCorInfo->PrintDebugString();
Resp.send(message);
usleep(20000);
}
}
%%
i thought i does not require it work on non-block.
so i can't understand this problem . maybe this is bug!
- Dominant language
- C++
- Stars
- 2.3k
- Forks
- 798
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from zeromq/cppzmq
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Add CURVE default keys constantsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
-
Difficulty 1/5 Under an hour Newbie friendliness 15/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Icinga/icinga2#11077 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
agent:WSL bug linux LOW ui
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Copter: PosHold brake-entry threshold became 16 deg instead of 0.16 deg after the radians conversionOpen
Difficulty 1/5 Under an hour Newbie friendliness 78/100
ArduPilot/ardupilot#34617 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
tesseract-robotics/tesseract_nanobind#168 ·
Maintainers usually reply within 1 day