JNICCC.h
00001
00039 #ifndef JNICCC_H_
00040 #define JNICCC_H_
00041
00042 #include "ccc.h"
00043 #include <jni.h>
00044
00045 class JNICCCFactory;
00046
00047 class JNICCC: public CCC {
00048
00049 friend JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_initNative (JNIEnv *env, jobject self);
00050
00051 private:
00052
00053 jobject _objCCC;
00054 JavaVM* _javaVM;
00055
00056 jmethodID _methodInit;
00057 jmethodID _methodClose;
00058 jmethodID _methodOnACK;
00059 jmethodID _methodOnLoss;
00060 jmethodID _methodTimeout;
00061 jmethodID _methodOnPktSent;
00062 jmethodID _methodProcessCustomMsg;
00063
00064 public:
00065
00066 virtual ~JNICCC();
00067
00068 jobject getJavaCCC();
00069
00070
00071
00072
00073 void setACKTimer(const int& msINT);
00074
00075 void setACKInterval(const int& pktINT);
00076
00077 void setRTO(const int& usRTO);
00078
00079 void setPacketSndPeriod(const double sndPeriod);
00080
00081 void setCWndSize(const double cWndSize);
00082
00083 const CPerfMon* getPerfInfo();
00084
00085 private:
00086
00087
00088
00089
00090 JNICCC(JNIEnv* env, jobject objCCC);
00091
00092 void init();
00093
00094 void close();
00095
00096 void onACK(const int32_t&);
00097
00098 void onLoss(const int32_t*, const int&);
00099
00100 void onTimeout();
00101
00102 void onPktSent(const CPacket*);
00103
00104 void onPktReceived(const CPacket*);
00105
00106 void processCustomMsg(const CPacket*);
00107
00108 };
00109
00110 #endif