Cookbook Example

How can I...?

Example 13: How to build a simple system for sending data from a UDP client to a UDP server. Components used: pipeline, Chargen, ConsoleEchoer, SimplePeer

Simple Kamaelia Example that shows how to use a simple UDP Peer. A UDP Peer actually sends and recieves however, so we could havemore fun example here with the two peers sending each other messages.

It's worth noting that these aren't "connected" peers in any shape or form, and they're fixed who they're sending to, etc, which is why it's a simple peer.


    from Kamaelia.Util.Console import ConsoleEchoer
    from Kamaelia.Util.PipelineComponent import pipeline
    from Kamaelia.Util.Chargen import Chargen
    from Kamaelia.Internet.UDP import SimplePeer

    server_addr = ""
    server_port = 1600

    SimplePeer(receiver_addr=server_addr, receiver_port=server_port),

    SimplePeer(localaddr=server_addr, localport=server_port),

    Source: Examples/example13/


Kamaelia is an open source project originated from and guided by BBC Research. For more information browse the site or get in contact.

This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)

(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved

This web site is powered by the same code created for the bicker manor project. For more details, contact Michael Sparks at BBC Research directly (cf contact)