I am trying to write an automated marking program in Delphi. It should work by polling a mailbox (POP3) every few minutes (seconds during a practice contest), test the program for correctness, allowing it only 2 seconds to execute and email results (SMTP) back to the sender.
Here is the breakdown so far:
Polling:
- retrieve messages from the mailbox constantly
- save all of the attachments
- create a new checking thread if mail exists
Marking:
- compile the program (c++, java, pascal, turing), and check for success
- run the program on a test case, kill it if it takes too long
- check the output against another file
- send an email back to the sender
The email stuff is where I am really having trouble, does Delphi have any VCL stuff to take care of this (I've looked through the help and come up with nothing)? What other ways can I do this?
Do the compilers send out exit codes? How do I check these from Delphi?
How can I terminate a process after it has run for a certain time?
Any other suggestions about improving this are also appreciated.
Here is the breakdown so far:
Polling:
- retrieve messages from the mailbox constantly
- save all of the attachments
- create a new checking thread if mail exists
Marking:
- compile the program (c++, java, pascal, turing), and check for success
- run the program on a test case, kill it if it takes too long
- check the output against another file
- send an email back to the sender
The email stuff is where I am really having trouble, does Delphi have any VCL stuff to take care of this (I've looked through the help and come up with nothing)? What other ways can I do this?
Do the compilers send out exit codes? How do I check these from Delphi?
How can I terminate a process after it has run for a certain time?
Any other suggestions about improving this are also appreciated.