Starting from:

$30

CS69012-Assignment 4 Online Judge or Autograder Solved

It will take codes , compile it, check for compilation errors, execute your code by providing some secret inputs and collect your code's output, check for runtime errors, and finally match your output with its hidden test outputs. 

 

In this assignment you need to implement file transfer protocol on top of TCP sockets and you will implement a console based Online Judge. There will be a server and multiple clients communicating with the server. Each client process will open a new connection with the server. Use select to handle multiple client requests. 

 

Each client can send a c/c++ file to the server through CODEJUD command and the server will reply to the client whether the given code is successful or giving error at any point of time during execution of code. If execution is successful then the server will also check and reply to the client about the acceptance of the c/c++ file. 

 

Problem :-  
-        Write two separate C programs one for TCP server (handles requests from multiple servers) and one for client. 

-        Multiple clients should be simultaneously able to communicate with the server. 

-        Server accepts connections from clients. 

-        Server receives control information like FTP commands over this connection. 

-        Server checks for valid commands, and executes them if there is no error. 

-        In order to transfer files etc. you can use ftp. And you can reuse your previous ftp setup. -       Handle corner cases. 

 

 

In Addition of previous ftp commands (RETR, STOR etc.) From assignment number 3. 

You have to implement and design the CODEJUD command. 

“CODEJUD” - This command will take a c/c++ file from client and server will compile , execute and match the output with given test cases and will notify back to client about any error or correctness of c/c++ file. 

 

Working of server and client is as follows:- 

*After successful connection- 

Three features to be added at server side- (CODEJUD​ )​
1.     Compilation Phase - This phase ​      will take a String that contains the source code and​             coding language (c/c++).This is the file client wants to test. This phase will compile the input and send compilation error messages to clients if any. Else it will create an o​bject file and send a compilation success message to the client. 

2.     Execution Phase​ -  This phase will take object file , time Limit(1sec). This phase will execute your code by providing some secret inputs if required. This phase will decide if the input file has any error (TLE or Runtime error). If it succeeds then it will create a new output.txt file and send an execution success message to the client. 

 

3.     Matching Phase​ - This phase will compare Correct testcase.txt file with the actual output.txt file, if it is matched then the successful message will be passed to client, else the wrong output message will be passed to client. 

 

Your final program will able to perform these ftp commands -: 

1.  RETR <filename 

2.  STOR <filename 

3.  LIST 

4.  ABOR (Optional). 

5.  QUIT 

6.  DELE <filename 

7.  ​CODEJUD <filename <ext(c/c++) 

More products