mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
zeromq: add support for network emulation
This commit is contained in:
parent
e6f346feca
commit
0fc5e1003c
1 changed files with 19 additions and 1 deletions
|
@ -542,6 +542,23 @@ int zeromq_poll_fds(struct node *n, int fds[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
int zeromq_netem_fds(struct node *n, int fds[])
|
||||
{
|
||||
int ret;
|
||||
struct zeromq *z = (struct zeromq *) n->_vd;
|
||||
|
||||
int fd;
|
||||
size_t len = sizeof(fd);
|
||||
|
||||
ret = zmq_getsockopt(z->out.socket, ZMQ_FD, &fd, &len);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
fds[0] = fd;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct plugin p = {
|
||||
.name = "zeromq",
|
||||
.description = "ZeroMQ Distributed Messaging (libzmq)",
|
||||
|
@ -559,7 +576,8 @@ static struct plugin p = {
|
|||
.destroy = zeromq_destroy,
|
||||
.read = zeromq_read,
|
||||
.write = zeromq_write,
|
||||
.poll_fds = zeromq_poll_fds
|
||||
.poll_fds = zeromq_poll_fds,
|
||||
.netem_fds = zeromq_netem_fds,
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue