Can ne1 help me on that?I will make a connection on a port to a server defined in the c:\gateway2.ini file. It will send the first line as cluster-agent defined in the ini file.
It will then check to see if the logfile exists. If it does exist it will check to see if an offset file exists. If it does it will read from the file from the offset and send the information to the server. It will then update the offset file with the new postion that has been read to in the file. It then searches thru the text read from the file to see if it contains the string "EXECUTE:" if it sees this string it will take the next chars up to the end of the line and execute them as an external command.
If it sees the string "OUTPUTFILE DONE" it will remove the file defined in the ini as outputfile.
The program then waits until the logfile contains more data appended to it. As soon as it does it will act as above sending just the new information from the offset.
Each one of these tasks alone is fairly simple. However, without an idea of your specific problem, you'll pretty much be ignored around here. We don't have time to do all of your work for you, and since you didn't tell us anything more than the program's requirements, we have no choice but to assume that's what you want.
Show us what you've done so far and what your having a problem with.
All About: File I/O in C++ might be of help.
Johnnie's Winsock Tutorial is another article that might give you some ideas.