#include "main.h" #define AUTO_RECONNECT CFSClient* thisclient; void ConnectWait(){ //printf("Connecting.."); thisclient->Connect("206.127.147.156", "6112"); while(!thisclient->IsConnected){ Sleep(100); } //printf("Connected to 206.127.147.156\n"); thisclient->SendInitialPacket(); } int main(int argc, char* argv[]) { thisclient = new CFSClient(); thisclient->RequestFile = 0x166;//0x13a3;//0x136b;//0x128b;//0x1244;//0x1203;//0x11b5;//0x1062; ConnectWait(); while(true){ Sleep(100); #ifdef AUTO_RECONNECT if(!thisclient->IsConnected){ thisclient->RequestFile++; thisclient->currentFileReceived = 0; thisclient->currentFileSize = 0; thisclient->io_service.reset(); ConnectWait(); } #endif } return 0; }