mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
@@ -0,0 +1,15 @@
|
||||
// the c version of selfdrive/messaging.py
|
||||
|
||||
#include <zmq.h>
|
||||
|
||||
// TODO: refactor to take in service instead of endpoint?
|
||||
void *sub_sock(void *ctx, const char *endpoint) {
|
||||
void* sock = zmq_socket(ctx, ZMQ_SUB);
|
||||
assert(sock);
|
||||
zmq_setsockopt(sock, ZMQ_SUBSCRIBE, "", 0);
|
||||
int reconnect_ivl = 500;
|
||||
zmq_setsockopt(sock, ZMQ_RECONNECT_IVL_MAX, &reconnect_ivl, sizeof(reconnect_ivl));
|
||||
zmq_connect(sock, endpoint);
|
||||
return sock;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define COMMA_VERSION "0.5.12-release"
|
||||
#define COMMA_VERSION "0.5.13-release"
|
||||
|
||||
Reference in New Issue
Block a user