Giter Club home page Giter Club logo

Comments (6)

gonzus avatar gonzus commented on June 25, 2024

Have you been able to reproduce this problem with the latest versions of 0MQ and the Java binding? I would also advise to bring this up on the mailing list, in case you have not done it already.

from jzmq.

gonzus avatar gonzus commented on June 25, 2024

Since there have been no comments since September 2010, I will close this issue. Feel free to open a new one if necessary.

from jzmq.

paolovictor avatar paolovictor commented on June 25, 2024

Hello.

I had a sudden detour from my project at the time, sorry for the (enormous) delay. This week I'll try to reproduce the bug with a more recent ZeroMQ version.

from jzmq.

paolovictor avatar paolovictor commented on June 25, 2024

Just to chime in, I couldn't reproduce the bug with the git versions of ZMQ stable and jzmq.

Here's the test code:

Java client:

import org.zeromq.ZMQ;

public class ZQMRepTest {
    public static void main(String[] args) {
        ZMQ.Context ctx = ZMQ.context(1);
        ZMQ.Socket socket = ctx.socket(ZMQ.REQ);

        System.out.println("Connecting...");
        socket.connect("tcp://127.0.0.1:5555");

        System.out.println("Sending...");
        socket.send(new byte[]{3}, 0);

        System.out.println("Receiving...");
        byte[] reply = socket.recv(0);

        System.out.println("Received: " + new String(reply));
    }
}

C server:

int main(int argc, char* argv) {
void* context = zmq_init(1);
void* socket = zmq_socket(context, ZMQ_REP);

zmq_bind(socket, "tcp://127.0.0.1:5555");

while(1) {
    zmq_msg_t request;
    zmq_msg_init(&request);

    zmq_msg_t reply;
    zmq_msg_init_size(&reply, 6);
    memcpy(zmq_msg_data(&reply), "Hello\0", 6);


    if(zmq_recv(socket, &request, ZMQ_NOBLOCK) == 0) {
        zmq_send(socket, &reply, 0);
        printf("Sent reply!\n");

        zmq_msg_close(&request);
        zmq_msg_close(&reply);
    }

    sleep(1);
}

return 0;
}

from jzmq.

gonzus avatar gonzus commented on June 25, 2024

OK, maybe this was something that was fixed since the initial report. More the reason to leave the issue closed. Thanks for telling us about your tests.

from jzmq.

hamroune avatar hamroune commented on June 25, 2024

Hi every one
I have the same test in Ubuntu 10.11 whith jzmq the problem is i dont receiv anything in subscriber

code :
public static void main(String[] args) {
ZMQ.Context ctx = ZMQ.context(1);
ZMQ.Socket socket = ctx.socket(ZMQ.REQ);

    System.out.println("Connecting...");
    socket.connect("tcp://127.0.0.1:5555");

    System.out.println("Sending...");
    socket.send(new byte[]{3}, 0);

    System.out.println("Receiving...");
    byte[] reply = socket.recv(0);

    System.out.println("Received: " + new String(reply));
}

the result is simply:

Connecting...
Sending...
Receiving..

I'm beginner in zmq so may forget something .

from jzmq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.