#include #include "../libsyncml/include/syncml.h" #include #include #include class myBase : public SyncMLDatabase { public: myBase() : SyncMLDatabase() {}; }; class mySessionHandler:public SMLSessionHandler { public: virtual void recDisplay(string what) { cout << "DISPLAY--> " << what << " <--DISPLAY" << endl; } }; void main() { ifstream i("toserver"); ofstream o("toclient"); SyncMLSingleThread *tester = new SyncMLSingleThread(); tester->addDatabase(new myBase); cout << "rdbuf: " << (void*)i.rdbuf() << endl; // cout << "ia: " << (void*)(i.rdbuf()->in_avail) << endl; tester->connect(&i,&o,SMLURI(),SMLURI(),new mySessionHandler(), true); delete tester; i.close(); o.close(); }