Comments (6)
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.
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.
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.
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.
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.
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)
- error: illegal character: '\u00a0' HOT 2
- Error while executing mvn package HOT 1
- facing Event issue in Event.cpp file
- ZLoop synchronization
- IPC with unix domain socket no communication HOT 3
- JZMQ have Client-server pattern?ZMQ.CLIENT & ZMQ.SERVER?
- During build process crashes on make execution
- Java process memory consumption.
- Support for RADIO/DISH + join/leave group methods missing
- javac: invalid flag: -h
- More paths should be added to .gitignore
- No ZFrame or ZMsg in zmq.jar
- GPL or LGPL Licensing? HOT 1
- Android jzmq Support
- mvn package fails
- test fails on apple m1 chip using openjdk8
- Memory leak zmq msg_t initsize ?
- why do you use ZeroMQ HOT 1
- connected but can not receive msgs in pair-pair pattern
- IPC between Python and Java
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jzmq.