first commit
This commit is contained in:
76
CS2335/lab5/documents/NetTxt_Protocol.txt
Normal file
76
CS2335/lab5/documents/NetTxt_Protocol.txt
Normal file
@@ -0,0 +1,76 @@
|
||||
NetTxt Networking Protocol.
|
||||
|
||||
The network messages will be sent between the server and the client in pure text format, for ease of coding and debugging. Some of the messages can only be sent from the server to the client and others - only the other way around, while others still can be sent by the server or by the client.
|
||||
|
||||
The messages will be identified by an all-caps message type in the front of the message, and the different parts of each message will be delimited by the escaped unit separator character ( \037 ).
|
||||
|
||||
The following things will need to be negotiated over the network:
|
||||
|
||||
1. User joining/quitting the server.
|
||||
2. Chat messages (of the public and private variety).
|
||||
3. List users in a chat room (public or private).
|
||||
4. List documents on the server.
|
||||
5. List sections in a document. (Maybe instead the user should just get the whole document when he opens it up?)
|
||||
6. Create a new document.
|
||||
7. Create a new section in a document.
|
||||
8. Request lock on a section.
|
||||
9. Release lock on a section.
|
||||
10. Notify the server that we are starting to view / stopped viewing a document.
|
||||
11. Request latest version of a section (document?)
|
||||
12. Transmit latest version of a section (document?)
|
||||
|
||||
The messages that will need to be sent are as follows*:
|
||||
|
||||
SRVE - Server error. Rejection, drop, server quitting, etc. Format:
|
||||
SRVE^message
|
||||
|
||||
HELO - User is joining the server. Format:
|
||||
HELO^username
|
||||
|
||||
QUIT - User is quitting the server gracefully. Format:
|
||||
QUIT^username
|
||||
|
||||
CHAT - User is sending a chat message. Format:
|
||||
CHAT^username^docId^text
|
||||
Here, the docId parameter specifies which chat room the message belongs to.
|
||||
|
||||
ULST - The list of users in a chat room. Format:
|
||||
ULST^docId^usrCount^username1^username2^...
|
||||
Here, the docId parameter specifies which chat room the list belongs to, and the usrCount parameter specifies how many users there are in the chat room. That one parameter is only needed for parsing purposes.
|
||||
|
||||
DLST - The list of documents available on the server. Format:
|
||||
DLST^docCount^docId1^docName1^docId2^docName2^...
|
||||
Here, docCount specifies how many documents are in the list (for parsing purposes only), docIdN specifies the unique ID of the Nth document, and docNameN specifies the name of the Nth document.
|
||||
|
||||
DCMT - Transfers a document either from the server to the client or from the client to the server. Format:
|
||||
DCMT^docId^docName^loaded(1|0)^secCount^username^secId^secOrder^stamp^locked(0|1)^secName^secContents
|
||||
If the load flag is one, then each section also contains all the information pertinent to each section. If it set to 0, then only the section names and ids are transferred.
|
||||
|
||||
SCTN - Transfers a section of a document. Format:
|
||||
SCTN^username^docId^secId^secOrder^stamp^locked(0|1)^secName^secContents
|
||||
username is the name of the author of the latest update. docId is the id of the document in which the section appears. secId is the id of the section - just a hash key of its name, basically. secOrder is the order in which the section appears in the document. stamp is the timestamp. locked is 0 if the section is unlocked and 1 if it is locked. secName is the name of the section. secContents is the contents of the section.
|
||||
|
||||
RMSC - Remove section from a document. Format:
|
||||
RMSC^username^docId^secId
|
||||
|
||||
LOCK - Requests a lock on a section. Format:
|
||||
LOCK^username^docId^secId
|
||||
The order in which the section appears in the document is sufficient for the secId.
|
||||
|
||||
ULCK - Releases a lock on a section. Format:
|
||||
ULCK^username^docId^secId
|
||||
|
||||
VIEW - Notifies the server that the user has started viewing a document. Format:
|
||||
VIEW^username^docId
|
||||
|
||||
UVEW - Notifies the server that the user has stopped viewing a document. Format:
|
||||
UVEW^username^docId
|
||||
|
||||
UPDT - Requests the latest version of a document. Format:
|
||||
UPDT^username^docId
|
||||
|
||||
|
||||
* Note that here the ^ character serves to represent the unit separator character, which is \037.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user