Skip to content

Commit

Permalink
Add some documents for management GUI and protocol.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwanami committed Mar 18, 2013
1 parent 3d3ff3f commit 25c97bb
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 2 deletions.
Binary file added img/mm-conns.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/mm-methods.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 105 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,118 @@ The EPC has some debug functions for analyzing low level communication.

## Management Interface

TODO...
The EPC has a management interface for the EPC connections. Users can check the current connection status, inspect method specs and terminate the connection.

### Current Connections

Executing `M-x epc:controller`, one can display the list of current established connections.

![Current Connections](img/mm-conns.png)

This table shows following information:

| Column | Note |
|--------|------|
| <Process> | Process name |
| <Proc> | Process status (`process-status` for the process) |
| <Conn> | Connection status (`process-status` for the TCP connection) |
| Title | Connection title which is defined by the EPC user program. |
| Command | Process command and arguments. |
| Port | TCP port which is opened by the remote process. |
| Methods | Number of methods which are defined at the Emacs side. |
| Live sessions | Number of sessions which are waiting for a return value.|

One can use following key-bind:

| Key | Command | Note |
|-----|---------|------|
| g | `epc:controller-update-command` | Refresh the table. |
| R | `epc:controller-connection-restart-command` | Restart the selected connection. |
| D,K | `epc:controller-connection-kill-command` | Kill the selected process and connection. |
| m,RET | `epc:controller-methods-show-command` | Display a method list of the remote process. (See the next sub-section for details.) |
| B | `epc:controller-connection-buffer-command` | Display the connection buffer. |

### Remote Method List

Displaying a method list, one can inspect the methods which are defined by the remote process.

![Remote Method List](img/mm-methods.png)

This table shows following information:

| Column | Note |
|--------|------|
| Method Name | Method name to call.|
| Arguments | [optional] Argument names.|
| Document | [optional] Method spec document.|

Here, 'Arguments' and 'Document' may be blank, because those are not essential slots.

| Key | Command | Note |
|-----|---------|------|
| e | `epc:controller-methods-eval-command` | Evaluate the selected remote method with some arguments. |
| q | `bury-buffer`| Bury this buffer. |

# Implementation

This section describes the EPC architecture and the wire-protocol so as to implement the peer stacks.

## Protocol Details

TODO...
The EPC protocol is based on the SWANK protocol.

- [Understanding SLIME (Using Emacs and Lisp Cooperatively)](http://bc.tech.coop/blog/081209.html)

### Message Envelope

- PAYLOAD-LENGTH : 24-bit hex-encoded integer
- PAYLOAD-CONTENT : S-expression, text, utf-8
- (MESSAGE-TYPE . MESSAGE-BODY-LIST)

- MESSAGE-TYPE : `call` | `return` | `return-error` | `epc-error` | `methods`
- MESSAGE-BODY-LIST : (Dependent on message types.)

### Message [call]

This message represents initiating method calling.

- MESSAGE-BODY-LIST : `(call UID METHOD-NAME ARGS)`
- UID : The session ID, which is an unique ID generated by the caller side.
- METHOD-NAME : A symbol for method name.
- ARGS : A list of method arguments.

### Message [return]

This message represents the normal finish of the method calling.

- MESSAGE-BODY-LIST : `(return UID RETURN-VALUE)`
- UID : The session ID to return.
- RETURN-VALUE : A return object.

### Message [return-error]

This message represents the application error, which is due to the application.

- MESSAGE-BODY-LIST : `(return-error UID ERROR-MESSAGE)`
- UID : The session ID to return.
- ERROR-MESSAGE : An error message.

### Message [epc-error]

This message represents the EPC error, which is due to the EPC stack.

- MESSAGE-BODY-LIST : `(epc-error UID ERROR-MESSAGE)`
- UID : The session ID to return.
- ERROR-MESSAGE : An error message.

### Message [methods]

This message represents the method query.

- MESSAGE-BODY-LIST : `(methods UID)`
- UID : The session ID, which is an unique ID generated by the caller side.

The response message is returned by the `return` message.

## Other Stacks

Expand Down

0 comments on commit 25c97bb

Please sign in to comment.