Skip to content

An example to send and receive a bundle #62

Open
@sergeLabo

Description

It would be useful to have an example about sending/sharing a bundle with a client.
I am currently working on how to use a bundle so I can send a list of list, latest being coordinate.

Here is my current progress :

Client:

points = [[1, 2, 3], [4, 5, 6]]

bundle = []

for i, msg in `enumerate(points):
    tag = ('/' + str(i)).encode('utf-8')
    bundle.append([tag, msg])

client.send_bundle(bundle)

Server:

def on_tag(*args):
    print(args)

for i in range(10):
    tag = ('/' + str(i)).encode('utf-8')
    server.bind(tag, on_tag, get_adress=True)

Is it good so far ?
Thanks you for your feedback.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions