[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octave forge package zeromq 1.0.0 released

From: John Donoghue
Subject: Re: octave forge package zeromq 1.0.0 released
Date: Sat, 27 Feb 2016 19:23:36 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 02/27/2016 06:12 PM, Doug Stewart wrote:
a hint as to how to use this in octave.
Its almost the same as using it in C - - take a look at zmq_test.m from the package as a very basic example of it.

A basic example:

% create server at port 8071
server = zmq_socket(ZMQ_SOCK_PUB);
zmq_bind( server, "tcp://*:8071");

% create client, connect to server and subscrive everything the server might send
client = zmq_socket(ZMQ_SOCK_SUB);
zmq_connect( client, "tcp://")
zmq_setsockopt(client, ZMQ_OPT_SUBSCRIBE, "");

% wait for everything to be connected/running

% send something from the server
zmq_send (server, uint8([104 101 108 108 111]));

# recieve whatever we can at the client
data = zmq_recv (client, 10)

% close client and server
zmq_close (client);
zmq_close (server);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]