TCPBasicClientApp.h

Go to the documentation of this file.
00001 //
00002 // Copyright 2004 Andras Varga
00003 //
00004 // This library is free software, you can redistribute it and/or modify
00005 // it under  the terms of the GNU Lesser General Public License
00006 // as published by the Free Software Foundation;
00007 // either version 2 of the License, or any later version.
00008 // The library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00011 // See the GNU Lesser General Public License for more details.
00012 //
00013 
00014 #ifndef __INET_TCPBASICCLIENTAPP_H
00015 #define __INET_TCPBASICCLIENTAPP_H
00016 
00017 #include <omnetpp.h>
00018 #include "TCPGenericCliAppBase.h"
00019 
00020 
00024 class INET_API TCPBasicClientApp : public TCPGenericCliAppBase
00025 {
00026   protected:
00027     cMessage *timeoutMsg;
00028     bool earlySend;  // if true, don't wait with sendRequest() until established()
00029     int numRequestsToSend; // requests to send in this session
00030 
00032     virtual void sendRequest();
00033 
00034   public:
00035     TCPBasicClientApp();
00036     virtual ~TCPBasicClientApp();
00037 
00038   protected:
00040     virtual void initialize();
00041 
00043     virtual void handleTimer(cMessage *msg);
00044 
00046     virtual void socketEstablished(int connId, void *yourPtr);
00047 
00049     virtual void socketDataArrived(int connId, void *yourPtr, cPacket *msg, bool urgent);
00050 
00052     virtual void socketClosed(int connId, void *yourPtr);
00053 
00055     virtual void socketFailure(int connId, void *yourPtr, int code);
00056 };
00057 
00058 #endif
00059 
00060