Check out the below file for details: Server.cpp : https://github.com/pkc232/NITW-Code-Judge/blob/master/CODE/SERVER.cpp
The Judge works on a Server - Client architecture and has the following features:
- User uploads the code file on the judge
- The judge compiles the code file to generate a binary.
- The judge returns any compilation errors if it occurs.
- The generated binary is then executed in a sandbox environment against a set of input files.
- We change the file descriptors to map the console I/O to file I/O.
- The binary generates an output file which is checked against a pre-generated output file to return the number of test cases passed.
Server Architecture (Using a Super Server approach): Its functionalities:
- Every client first makes a connection with the super server.
- The super server forks out a different server process to cater the needs of the client.