Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

when i send it will show "Resource temporarily unavailable"

Open
#548 3 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from zeromq/cppzmq

All issues in zeromq/cppzmq

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.