Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Platform/Aperios1.3.2/UDPBroadcastHandler.cpp

Go to the documentation of this file.

    00001 /**
    00002 * @file  Platform/Aperios1.3.2/UDPBroadcastHandler.cpp
    00003 *
    00004 * Class for using NetReceivers for receiving UDP-Broadcasts
    00005 * @author <A href=mailto:robocup@m-wachter.de>Michael Wachter</A>
    00006 *
    00007 */
    00008
    00009 #include "UDPBroadcastHandler.h"
    00010 #include <tools/debugging/debugging.h>
    00011
    00012 #include <stdio.h>
    00013 #include <iostream.h>
    00014
    00015 UDPBroadcastHandler::UDPBroadcastHandler()
    00016 :UDPEndpoint()
    00017 {
    00018 }
    00019
    00020
    00021 void UDPBroadcastHandler::start(NetReceiverBase& theReceiver, int port)
    00022 {
    00023   receiver = &theReceiver;
    00024   bind(port);
    00025 }
    00026
    00027 void UDPBroadcastHandler::onReceive(void* data,int size)
    00028 {
    00029     receiver->package = data;
    00030   receiver->size = size;
    00031     receiver->onReceive();
    00032 }
    00033
    00034
    00035
    00036
    00037   // cout << "\n";
    00038