[zeromq-dev] ZMQException: Errno 48 : Address already in use
Trevor Bernard
trevor.bernard at gmail.com
Wed Sep 10 12:05:06 CEST 2014
INPROC is not properly supported on JeroMQ. It translate the bind to
"tcp://127.0.0.1:port". If you want INPROC, use JZMQ.
On Wed, Sep 10, 2014 at 3:22 AM, 曾纪川 <zengjichuan at outlook.com> wrote:
> Thanks for the answer. If I use client.bind("ipc://yo:15545"); server will
> receive msg as expected. If not use bind, server cannot receive msg, but
> when I use client.bind("inproc://yo:15545"); the Errno 48 will raise. I need
> to set both sides' bind address, cause there are other DEALERs would connect
> to them.
>
> Best Regards,
> Zeng Jichuan
>
>
> ________________________________
> Date: Tue, 9 Sep 2014 23:46:51 -0600
> From: optionguy71 at gmail.com
> To: zeromq-dev at lists.zeromq.org
> Subject: Re: [zeromq-dev] ZMQException: Errno 48 : Address already in use
>
>
> One side should bind, and the other should use connect.
>
> On Sep 9, 2014 11:39 PM, "曾纪川" <zengjichuan at outlook.com> wrote:
>
> I just start to learn ZMQ in java(jeromq-0.3.4, Ubuntu 14.10, java-1.8), I
> want to design a N:N connection network which suppose to be the model
> ROUTER-ROUTER
> The problem is ROUTER will raise "Errno 48 : Address already in use" when I
> set both Routes' bind address to be "inproc", it will
> be all right in both non-inproc addresses, or one side non-inproc addr. So
> how can I set both sides inproc addr and keep connection.
>
> code list :
>
> ZMQ.Socket server = ctx.createSocket(ZMQ.ROUTER);
> server.setIdentity(connectEndpoint.getBytes());
> server.bind(bindEndpoint);
> System.out.printf ("I: service is ready at %s\n", bindEndpoint);
>
> ZMQ.Poller poller = new ZMQ.Poller(1);
> poller.register(new ZMQ.PollItem(server, ZMQ.Poller.POLLIN));
>
> while (!Thread.currentThread().isInterrupted()) {
> ZMsg request = null;
> poller.poll();
> if(poller.pollin(0)){
> request = ZMsg.recvMsg(server);
> }
> if (request == null)
> break; // Interrupted
>
> System.out.println("Server received: "+request);
> }
>
>
> ZMQ.Socket client = ctx.createSocket(ZMQ.ROUTER);
> client.setIdentity("client1".getBytes());
> client.bind("inproc://yo:15545");
> //client.bind("ipc://yo:15545"); // it works
> client.connect(bindEndpoint); //errno
>
> ZMsg request = new ZMsg();
> request.add("");
> request.add("Client Message");
> request.push(connectEndpoint);
> request.send(client);
>
> exception:
> Exception in thread "main" org.zeromq.ZMQException: Errno 48 :
> Address already in use
> at org.zeromq.ZMQ$Socket.mayRaise(ZMQ.java:1344)
> at org.zeromq.ZMQ$Socket.connect(ZMQ.java:1157)
> at TestId.main(TestId.java:54)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
>
> Best Regards,
> Zeng Jichuan
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
> _______________________________________________ zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
More information about the zeromq-dev
mailing list