You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (zmq_msg_close(&event_msg) < 0) {
raise_exception(env, zmq_errno());
return NULL;
}
// the addr part is a pointer to a c string that libzmq might have already called free on
// it is not to be trusted so better not use it at all
switch (event.event) {
case ZMQ_EVENT_CONNECTED:
return env->NewObject(cls, constructor, event.event, event.data.connected.fd, NULL);
case ZMQ_EVENT_CONNECT_DELAYED:
return env->NewObject(cls, constructor, event.event, event.data.connect_delayed.err, NULL);
case ZMQ_EVENT_CONNECT_RETRIED:
return env->NewObject(cls, constructor, event.event, event.data.connect_retried.interval, NULL);
case ZMQ_EVENT_LISTENING:
return env->NewObject(cls, constructor, event.event, event.data.listening.fd, NULL);
case ZMQ_EVENT_BIND_FAILED:
return env->NewObject(cls, constructor, event.event, event.data.bind_failed.err, NULL);
case ZMQ_EVENT_ACCEPTED:
return env->NewObject(cls, constructor, event.event, event.data.accepted.fd, NULL);
case ZMQ_EVENT_ACCEPT_FAILED:
return env->NewObject(cls, constructor, event.event, event.data.accept_failed.err, NULL);
case ZMQ_EVENT_CLOSED:
return env->NewObject(cls, constructor, event.event, event.data.closed.fd, NULL);
case ZMQ_EVENT_CLOSE_FAILED:
return env->NewObject(cls, constructor, event.event, event.data.close_failed.err, NULL);
case ZMQ_EVENT_DISCONNECTED:
return env->NewObject(cls, constructor, event.event, event.data.disconnected.fd, NULL);
default:
return NULL;
}
mv -f .deps/libjzmq_la-Poller.Tpo .deps/libjzmq_la-Poller.Plo
/bin/bash ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/lib/jvm/java-8-openjdk-amd64/include -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux -Wall -g -O2 -MT libjzmq_la-Event.lo -MD -MP -MF .deps/libjzmq_la-Event.Tpo -c -o libjzmq_la-Event.lo
test -f 'Event.cpp' || echo './'
Event.cpplibtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/lib/jvm/java-8-openjdk-amd64/include -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux -Wall -g -O2 -MT libjzmq_la-Event.lo -MD -MP -MF .deps/libjzmq_la-Event.Tpo -c Event.cpp -fPIC -DPIC -o .libs/libjzmq_la-Event.o
Event.cpp: In function ‘_jobject* Java_org_zeromq_ZMQ_00024Event_recv(JNIEnv*, jclass, jlong, jint)’:
Event.cpp:60:5: error: ‘zmq_event_t’ was not declared in this scope
zmq_event_t event;
^~~~~~~~~~~
Event.cpp:72:13: error: ‘event’ was not declared in this scope
memcpy(&event.event, data, sizeof(event.event));
^~~~~
Makefile:579: recipe for target 'libjzmq_la-Event.lo' failed
make[2]: *** [libjzmq_la-Event.lo] Error 1
make[2]: Leaving directory '/root/jzmq-3.1.0/src/main/c++'
Makefile:429: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/root/jzmq-3.1.0/src/main/c++'
Makefile:401: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
i am getting this issue on debian 9. after changes content as per below it's helps.
#include <assert.h>
#include <zmq.h>
#include
#include
#include "jzmq.hpp"
#include "util.hpp"
#include "org_zeromq_ZMQ_Event.h"
static jmethodID constructor;
JNIEXPORT void JNICALL
Java_org_zeromq_ZMQ_00024Event_nativeInit (JNIEnv *env, jclass cls)
{
constructor = env->GetMethodID(cls, "", "(IILjava/lang/String;)V");
assert(constructor);
}
static zmq_msg_t*
read_msg(JNIEnv *env, void *socket, zmq_msg_t *msg, int flags)
{
int rc = zmq_msg_init (msg);
if (rc != 0) {
raise_exception (env, zmq_errno());
return NULL;
}
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3,0,0)
rc = zmq_recvmsg (socket, msg, flags);
#else
rc = zmq_recv (socket, msg, flags);
#endif
int err = zmq_errno();
if (rc < 0 && err == EAGAIN) {
rc = zmq_msg_close (msg);
err = zmq_errno();
if (rc != 0) {
raise_exception (env, err);
return NULL;
}
return NULL;
}
if (rc < 0) {
raise_exception (env, err);
rc = zmq_msg_close (msg);
err = zmq_errno();
if (rc != 0) {
raise_exception (env, err);
return NULL;
}
return NULL;
}
return msg;
}
JNIEXPORT jobject JNICALL
Java_org_zeromq_ZMQ_00024Event_recv (JNIEnv *env, jclass cls, jlong socket, jint flags)
{
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3,2,2)
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4,0,0)
assert (zmq_msg_more(&event_msg) != 0);
return env->NewObject(cls, constructor, event, value, address);
#else
assert (zmq_msg_more(&event_msg) == 0);
zmq_event_t event;
// copy event data to event struct
memcpy (&event, zmq_msg_data (&event_msg), sizeof(event));
#endif // ZMQ_VERSION >= ZMQ_MAKE_VERSION(4,0,0)
#else
return NULL;
#endif // ZMQ_VERSION >= ZMQ_MAKE_VERSION(3,2,2)
}
so please provide correct file for isntallation
https://github.com/zeromq/jzmq/archive/v3.1.0.tar.gz .
The text was updated successfully, but these errors were encountered: