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

# Platform/Aperios1.3.2/TCPHandler.h

Go to the documentation of this file.

    00001 /**
    00002 * @file  Platform/Aperios1.3.2/TCPHandler.h
    00003 *
    00004 * Class for using NetSender/NetReceivers over a TCP connection
    00005 *
    00006 * @author <A href=mailto:robocup@m-wachter.de>Michael Wachter</A>
    00007 */
    00008
    00009 #ifndef _TCPHandler_H_
    00010 #define _TCPHandler_H_
    00011
    00012 class TCPHandler;
    00013
    00014 #include "TCPEndpoint.h"
    00015 #include "NetHandler.h"
    00016 #include "NetSender.h"
    00017 #include "NetReceiver.h"
    00018
    00019 class TCPHandler : public TCPEndpoint, public NetHandler
    00020 {
    00021    public:
    00022      TCPHandler(){};
    00023      TCPHandler(NetSenderBase& theSender, NetReceiverBase& theReceiver);
    00024      void setTransmitters(NetSenderBase& theSender, NetReceiverBase& theReceiver);
    00025      virtual void onReceive(void* someData, int size);
    00026      virtual void onConnect(void);
    00027      virtual void onClose(int reason);
    00028      virtual void onSendingDone(void);
    00029      virtual void sendPackage(int senderNumber,void* someData,int size);
    00030
    00031    private:
    00032      NetReceiverBase* receiver;
    00033      NetSenderBase* sender;
    00034
    00035      void* receiveBuffer;
    00036      int sizeOfDataToRead;
    00037      bool sendingDone;
    00038 };
    00039
    00040
    00041 #endif