-
Notifications
You must be signed in to change notification settings - Fork 0
Implementation
#Implementation
When the server communicates with the client (and vice versa), we have the following basic protocol.
Message Type | From | To | Meaning |
---|---|---|---|
1 | Client | Server | Request to connect |
2 | Server | Client | Update to environment |
3 | Client | Server | Interpreter command |
4 | Server | Client | Interpreter command ACK |
5 | Client | Server | Graceful exit |
6 | Server | Client | Interpreter file transfer |
7 | Server | Client | logfile transfer |
8 | Server | Client | Accepted connection |
-
The files logfile.scm and intermediate are generated by the server. No files with these names should be in the same directory as the server.
-
On the client-side, the file names uscheme1 and logfile.scm are reserved.
-
The current client is multi-threaded, reading from and writing to the server concurrently.
-
A graceful exit provides the user with a copy of the interpreter as well as a log with all the commands provided to the interpreter. This is used to create an offline interpreter with the same current environment.
-
The server uses the
select
function to queue incoming interpreter results, giving precedence to clients who connected earlier. -
The server is concurrent, using two processes. One runs a uScheme interpreter while the other interacts with clients.