VR-Link API Documentation for DIS
vlTcpForwarder.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992, 1997 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: vlTcpForwarder.h,v $ $Revision: 1.1.6.1 $ $State: Exp $
00007 *********************************************************************/
00008 #ifndef vlTcpForwarder_H_
00009 #define vlTcpForwarder_H_
00010 
00013 
00014 #include <vlutil/vlMachineTypes.h>
00015 #include <vlutil/vlNetTypes.h>
00016 #include <vlutil/vlUtil.h>
00017 
00018 #include "vlSocket.h"
00019 #include "vlTcpSocketMgr.h"
00020 
00021 #ifdef DtUSE_UTILITIES_NAMESPACE
00022 namespace DtUSE_UTILITIES_NAMESPACE
00023 {
00024 #endif
00025 
00026 
00027 class DtClock;
00028 
00029 class DT_DLL_NETCOMPAT DtTcpForwarder
00030 {
00031 public:
00032    DtTcpForwarder(int port=DtDEFAULT_PORT);
00033    
00039    DtTcpForwarder(DtSocketCreationCallback cb, void* socketCreator, int port=DtDEFAULT_PORT);
00040 
00041    virtual ~DtTcpForwarder();
00042    
00043    virtual void sendToAll(caddr_t packet, size_t size);
00044 
00045    virtual void readAndForward(
00046       DtTime maxTimeOverAll, DtTime maxTimePerSocket);
00047    
00050    virtual void readAndForward(DtTcpSocket* sock, DtTime stopTime);
00051 
00052    virtual DtTcpSocketMgr* socketMgr();
00053 
00057    virtual int sizeLength();
00058    virtual int sizeOffset();
00059    virtual void setSizeLength(int offset);
00060    virtual void setSizeOffset(int length);
00061    
00062 protected:
00063 
00064    DtTcpSocketMgr* mySocketMgr;
00065    DtTcpSocket* myBeginSocket;
00066    DtListItem* myBeginItem;
00067    DtClock  myClock;
00068 
00070    const DtList* mySockList;
00071 };
00072 
00073 inline int DtTcpForwarder::sizeLength()
00074 {
00075    return mySocketMgr->sizeLength();
00076 }
00077 
00078 inline int DtTcpForwarder::sizeOffset()
00079 {
00080    return mySocketMgr->sizeOffset();
00081 }
00082 
00083 #ifdef DtUSE_UTILITIES_NAMESPACE
00084 } 
00085 #endif
00086 
00087 
00088 #endif

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)